Ok well im busy coding a web site, its a link exchange web site that works by rather having every site display a link randomly selected from the link text file and it was working perfectly and then when i uploaded it the random link wasn't displayed at but the second static link did display and i cant seem to understand what is going on so my question is this... When calling a php file from a remote server should i use an echo statement to print the text or should i on the server not hosting the file use the file_get_contents statement or is there a better way?
Remote php file access and reading
You should be using MySQL for the links. MySQL beats .txt entries all the time. It's much easier to randomly select a link from a MySQL database then a text file. Below are some sites that will help you to start using MySQL. Trust me, it's worth it.
http://www.tizag.com/mysqlTutorial/
http://www.devshed.com/c/a/MySQL/Beginning-MySQL-Tutorial/
I'd go with the first one, as it classifies, while making it easy to read, information better. The best thing is that if you are using Frihost you have MySQL free of charge!
Good luck.
http://www.tizag.com/mysqlTutorial/
http://www.devshed.com/c/a/MySQL/Beginning-MySQL-Tutorial/
I'd go with the first one, as it classifies, while making it easy to read, information better. The best thing is that if you are using Frihost you have MySQL free of charge!
Good luck.
I think the best way would be to use curl to get the contents of the file and then parse it.
Ok wel the thing is i am purposefully trying not to use non php and simple methods and databases. MySQL is way to easy to break into and write to the database and the scripts are under 30kb in total and MYSQL would enlarge it. But thanks for the advice... The cURL idea i rather did like but for this project i cant use it.
mysql isn't that easy to hack in to. If you have a 10char long password and a 10char long username the hacker would need a lot of luck to get in.
Mysql might enlarge it, but it would speed it up and make it easier to work with.
I don't really understand what you exactly want, but file_get_contents is slow.
Mysql might enlarge it, but it would speed it up and make it easier to work with.
I don't really understand what you exactly want, but file_get_contents is slow.
Thanks for all the help I finally got the site to work properly and three other sites as well... I was making a mistake with the .htaccess file and that was preventing the site from functioning correctly. I uploaded the .htaccess in binary mode by mistake.... No wonder the entire script was dieing and moaning.
Thanks to everyone!
Thanks to everyone!
Related topics
