scorpiious Posted April 27, 2007 Share Posted April 27, 2007 well im not the best at php so i gotta ask some questions, i was making a dynamic signature application and im wondering how would you take the data off of another page and split it up? so far i have $name = $_GET["user"]; $string = fopen("http://hiscore-web.runescape.com/aff/runescape/hiscorepersonal.cgi?username=".$name,"r"); where should i go from here? Link to comment https://forums.phpfreaks.com/topic/48970-parsing-data-off-a-page/ Share on other sites More sharing options...
JakeTheSnake3.0 Posted April 27, 2007 Share Posted April 27, 2007 Well....fopen() opens a FILE on a server...so when you pass the string that you have there, it isn't pointing to a location on a server. You're just giving it a url...it would have to be something like...http://hiscore-web.runescape.com/aff/runescape/files/myfile.txt. If the file name is like....bob.txt, then it would make sense what you're trying to do.... // get the original contents (supposedly for an email, since you're doing "signatures")... $contents = $_GET['contents']; // username of the email author supposedly.. $name = $_GET['user']; // directory where all of the signature text files reside... $directory = 'http://hiscore-web.runescape.com/aff/runescape/files/'; // open up the appropriate signature file... $file = fopen($directory . $name . '.txt', 'r'); // read it's contents $data = fread($file, filesize($directory . $name . '.txt')); // append the contents of the signature file to the contents of the email... $contents .= $data; Link to comment https://forums.phpfreaks.com/topic/48970-parsing-data-off-a-page/#findComment-239944 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.