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 />"; } ?> Link to comment https://forums.phpfreaks.com/topic/81840-base-64-encoding/ 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++; } ?> Link to comment https://forums.phpfreaks.com/topic/81840-base-64-encoding/#findComment-415780 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 Link to comment https://forums.phpfreaks.com/topic/81840-base-64-encoding/#findComment-415886 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++; } ?> Link to comment https://forums.phpfreaks.com/topic/81840-base-64-encoding/#findComment-415903 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!! Link to comment https://forums.phpfreaks.com/topic/81840-base-64-encoding/#findComment-415925 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.