leafbug Posted December 15, 2007 Share Posted December 15, 2007 I want my code to work in a way where the directory $test is the only thing thats echoed in base 64. If this is possible please tell me how its done. <?php //base64_encode($test); dont know where to put this for ($test=0; $test<10; $test++){ echo "http://www.site.com/$test/<br />"; } ?> Quote Link to comment Share on other sites More sharing options...
papaface Posted December 15, 2007 Share Posted December 15, 2007 ... of course: <?php //base64_encode($test); dont know where to put this $test = base64_encode("something"); for ($test=0; $test<10; $test++){ // NOT SURE WHAT THIS IS SUPPOSED TO DO..... echo "http://www.site.com/$test/<br />"; } ?> Edit. If you want it to increment a number do this: <?php //base64_encode($test); dont know where to put this $test = base64_encode("0"); while ($test<10){ echo "http://www.site.com/".$test."/<br />"; $test++; } ?> Quote Link to comment Share on other sites More sharing options...
leafbug Posted December 16, 2007 Author Share Posted December 16, 2007 Thank you for your reply! Yes I do want to increment but the 2nd code you posted doesnt work, the php script never finishes loading. Any more ideas? I would appreciate it alot!! thanks again Quote Link to comment Share on other sites More sharing options...
papaface Posted December 16, 2007 Share Posted December 16, 2007 Sorry should have been <?php //base64_encode($test); dont know where to put this $test = 0; while ($test<10){ echo "http://www.site.com/".base64_encode($test)."/<br />"; $test++; } ?> Quote Link to comment Share on other sites More sharing options...
leafbug Posted December 16, 2007 Author Share Posted December 16, 2007 It worked Now I can complete my mission thx! farewell!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.