tass2001 Posted December 4, 2007 Share Posted December 4, 2007 Okay so im writting a script to get myspace Variable information (i.e. about me, music, etc.) and output it as XML Now i have the current script: <?PHP $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $LOGINURL = "http://www.myspace.com/imparanoid000"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); url_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); $result = curl_exec($ch); curl_close($ch); echo '<span style="font-size: 12px; font-family: Verdana">'; $pieces = explode("About me:(/span><br/>", $result); $aboutme = $pieces[1]; $pieces = explode("<span class=\"text\"><div style=\"display:none;\">", $aboutme); $aboutme = $pieces[1]; $pieces = explode("</div>", $aboutme); $aboutme = $pieces[0]; $aboutme = str_replace("\r\n", "<br>", $aboutme); echo "<b><u>Yo</u></b>".$aboutme."<br> ?> Idk why this code isn't working! it keeps outputing Parse error: syntax error, unexpected $end in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\get.php on line 23 Why?? Also is there anyway for me to say do get.php?url=urlhere and have php insert it into the end of the LOGINID variable?? Quote Link to comment https://forums.phpfreaks.com/topic/80052-explode-and-myspace-strings/ Share on other sites More sharing options...
pocobueno1388 Posted December 4, 2007 Share Posted December 4, 2007 The parse error is coming from this line echo "<b><u>Yo</u></b>".$aboutme."<br> Change it to echo "<b><u>Yo</u></b>".$aboutme."<br>"; Quote Link to comment https://forums.phpfreaks.com/topic/80052-explode-and-myspace-strings/#findComment-405628 Share on other sites More sharing options...
btherl Posted December 4, 2007 Share Posted December 4, 2007 There were two typos <?PHP $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $LOGINURL = "http://www.myspace.com/imparanoid000"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); # <-- missing curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); $result = curl_exec($ch); curl_close($ch); echo '<span style="font-size: 12px; font-family: Verdana">'; $pieces = explode("About me:(/span><br/>", $result); $aboutme = $pieces[1]; $pieces = explode("<span class=\"text\"><div style=\"display:none;\">", $aboutme); $aboutme = $pieces[1]; $pieces = explode("</div>", $aboutme); $aboutme = $pieces[0]; $aboutme = str_replace("\r\n", "<br>", $aboutme); echo "<b><u>Yo</u></b>".$aboutme."<br>" ; # <_ missing ?> Quote Link to comment https://forums.phpfreaks.com/topic/80052-explode-and-myspace-strings/#findComment-405630 Share on other sites More sharing options...
tass2001 Posted December 4, 2007 Author Share Posted December 4, 2007 now im getting Fatal error: Call to undefined function curl_init() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\get.php on line 5 ?? ??? Quote Link to comment https://forums.phpfreaks.com/topic/80052-explode-and-myspace-strings/#findComment-405635 Share on other sites More sharing options...
btherl Posted December 4, 2007 Share Posted December 4, 2007 That means that curl is not installed (or not enabled). Did you install php and apache as part of a package (and which package?) Quote Link to comment https://forums.phpfreaks.com/topic/80052-explode-and-myspace-strings/#findComment-405638 Share on other sites More sharing options...
tass2001 Posted December 4, 2007 Author Share Posted December 4, 2007 Uhh I installed PHP 5.2.5 installer [19,803Kb] - 15 November 2007 md5: f9396b654721d9a18c95ea6412c3d54e And Apache 2.2 Quote Link to comment https://forums.phpfreaks.com/topic/80052-explode-and-myspace-strings/#findComment-405640 Share on other sites More sharing options...
btherl Posted December 4, 2007 Share Posted December 4, 2007 I think you need to install the additional "binaries" from the download page as well. I'm not sure if you need the non-thread-safe or thread-safe unfortunately. I would try thread-safe first (the top one). Quote Link to comment https://forums.phpfreaks.com/topic/80052-explode-and-myspace-strings/#findComment-405657 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.