I want to put alot of urls into the php file, and once php file gets executed it will redirect to those urls one by one... like if I have 100 urls, once php file loads it will go to first url, then once php file get executed again it will load second url, and so on, then once it reaches the end it will start from the begging ... can someone hook me up please
quick php code help...
Collapse
X
-
Can get you up & running in no time with this. Get a hold on me on ICQ : 349-164-75I want to put alot of urls into the php file, and once php file gets executed it will redirect to those urls one by one... like if I have 100 urls, once php file loads it will go to first url, then once php file get executed again it will load second url, and so on, then once it reaches the end it will start from the begging ... can someone hook me up please
UUGallery Builder - automated photo/video gallery plugin for Wordpress!
Stop looking!
Checkout Naked Hosting, online since 1999 ! 

-
If you are looking to invest a few bucks, icq: 33375924Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip ManagerComment
-
Quick and dirty way to do it:
Will work. Untested, don't ask for me to fix it if it doesn't kick - pay woj instead.Code:<? $urls = file('URLS.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) $url = array_shift($urls); array_push($urls,$url); file_put_contents('URLS.txt',implode("\r\n",$urls)); header('Location:'.$url); ?>Comment
-
It helps to completely read what he was looking for.Quick and dirty way to do it:
Will work. Untested, don't ask for me to fix it if it doesn't kick - pay woj instead.Code:<? $urls = file('URLS.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) $url = array_shift($urls); array_push($urls,$url); file_put_contents('URLS.txt',implode("\r\n",$urls)); header('Location:'.$url); ?>Comment
-
array + array_rand - and it's all done...
read the manual...Make a bank with Chaturbate - the best selling webcam program
Ads that can't be block with AdBlockers !!! /// Best paying popup program (Bitcoin payouts) !!!
PHP, MySql, Smarty, CodeIgniter, Laravel, WordPress, NATS... fixing stuff, server migrations & optimizations... My ICQ: 27429884 | Email:
Comment
-
Comment
-
Yup, that would work.Quick and dirty way to do it:
Will work. Untested, don't ask for me to fix it if it doesn't kick - pay woj instead.Code:<? $urls = file('URLS.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) $url = array_shift($urls); array_push($urls,$url); file_put_contents('URLS.txt',implode("\r\n",$urls)); header('Location:'.$url); ?>
A real solution would be to use a db or even xml file, but quantum-x has a solution that will work quite well
Comment
-
Hmm. I don't think so. If the file had XX number of urls and took up XX amount of space at the beginning of the program it would still have xx number of urls and take up xx amount of space at the end. So, if the file fit on the HD before it still does after.
just
All cookies cleared!Comment
-
gives me this errorQuick and dirty way to do it:
Will work. Untested, don't ask for me to fix it if it doesn't kick - pay woj instead.Code:<? $urls = file('URLS.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) $url = array_shift($urls); array_push($urls,$url); file_put_contents('URLS.txt',implode("\r\n",$urls)); header('Location:'.$url); ?>
Parse error: syntax error, unexpected T_VARIABLE in /www/users/for/multiurl.php on line 3Comment
-
Second Line which is the first line of code needs a ; on the end.
EDIT: Didn't refresh page and see it had been answeredCode:$urls = file('URLS.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
David • 421-179-116 • support [@] adultnetworkuk [.] com
Website Development • Website Hosting • Model Index Software • Website Reviews and Links
Hit me up for more information on everything I do.Comment
-
It's happened to me. ;) When you open a file for write it's first truncated, so if there's something else writing at that time, or the file system allows a truncate but not write when it's chock full, you'll end up with a 0 byte file. For a rotating buffer like this it's probably better to use a pointer and save that in a separate file - at least if that gets trashed then it just starts at 0 again...Comment
-
... pay woj ...Comment
-
That should fix your problem. I highly suggest upgrading PHP to 5.xCode:<?php if(!function_exists('file_put_contents')) { function file_put_contents($filename, $data, $file_append = false) { $fp = fopen($filename, (!$file_append ? 'w+' : 'a+')); if(!$fp) { trigger_error('file_put_contents cannot write in file.', E_USER_ERROR); return; } fputs($fp, $data); fclose($fp); } } ?>Comment
-
after few runs i get this
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 128 bytes) in /www/users/for/multiurl.php on line 6Comment
-
hey switch, where do I put that ? instead of file_put_contents line?That should fix your problem. I highly suggest upgrading PHP to 5.xCode:<?php if(!function_exists('file_put_contents')) { function file_put_contents($filename, $data, $file_append = false) { $fp = fopen($filename, (!$file_append ? 'w+' : 'a+')); if(!$fp) { trigger_error('file_put_contents cannot write in file.', E_USER_ERROR); return; } fputs($fp, $data); fclose($fp); } } ?>Comment
-
Comment
-
Why the fuck are you running PHP4 - In one month's time it will have been discontinued for THREE YEARS.
No wonder shit is breaking ;)Comment
-
ok I put that before file_put_contents line and it works, but after it redirects to the site it deletes that site from urls.txt file for some reason ?That should fix your problem. I highly suggest upgrading PHP to 5.xCode:<?php if(!function_exists('file_put_contents')) { function file_put_contents($filename, $data, $file_append = false) { $fp = fopen($filename, (!$file_append ? 'w+' : 'a+')); if(!$fp) { trigger_error('file_put_contents cannot write in file.', E_USER_ERROR); return; } fputs($fp, $data); fclose($fp); } } ?>Comment
-
As with anything when you write to the filesystem. You should be / your host should be monitoring disc space anyhow.It's happened to me. ;) When you open a file for write it's first truncated, so if there's something else writing at that time, or the file system allows a truncate but not write when it's chock full, you'll end up with a 0 byte file. For a rotating buffer like this it's probably better to use a pointer and save that in a separate file - at least if that gets trashed then it just starts at 0 again...
If you're out of space PHP will probaby grind itself to death when attempting to even run
Comment
-
Comment
-
Comment
-
-
Comment
-
I found it on some site, I think it's one of those ex girlfriend site pics that are on every ex gf site.
I put the code on my dev server and ran it, by the looks of it, when putting the first url to the bottom, it's putting enters in there somewhere..Comment
-
That was my attempt to extort him, shhhhComment
-
Comment
-
something like this javascript popupI want to put alot of urls into the php file, and once php file gets executed it will redirect to those urls one by one... like if I have 100 urls, once php file loads it will go to first url, then once php file get executed again it will load second url, and so on, then once it reaches the end it will start from the begging ... can someone hook me up please
Code:<!-- var how_many_ads = 3; var now = new Date() var sec = now.getSeconds() var ad = sec % how_many_ads; ad +=1; if (ad==1) {url="http://www.url1.com/";} if (ad==2) {url="http://www.url2.com/";} if (ad==3) {url="http://www.url3.com/";} rotpop=window.open('','rotpop','toolbar=0,menubar=0,scrollbars=1,status=0,resizable=1,top=1,left=1,width=790,height=570'); rotpop.blur(); rotpop.location=url; -->
SUBMIT PORN BLOGS HERE
SUBMIT PORN STAR GALLERIES
Partner accounts for sale
ICQ 467879053
Trade Traffic
Trade Hardlinks
Dot Com Auction
Myspace Blog
Now Hiring My network is in need of clean, honest, good traders for different niches. ContactComment



AIM: GrouchyGfy
btw, it should not have any issues with big files? or it's limited to like 1-100 urls or so ?
Comment