s4salman Posted April 1, 2009 Share Posted April 1, 2009 I am trying to create RSS using PHP but getting error message : Parse error: syntax error, unexpected $end in /home/hesla/public_html/rss.php on line 127 I am using this code. Please help me in this. <?php if (!ini_get("register_globals")) { import_request_variables('GPC'); } //توافق نسخ البي اتش بي $phpver = phpversion(); if ($phpver < '4.1.0') { $_GET = $HTTP_GET_VARS; $_POST = $HTTP_POST_VARS; $_SERVER = $HTTP_SERVER_VARS; } $phpver = explode(".", $phpver); $phpver = "$phpver[0]$phpver[1]"; if ($phpver >= 41) { $PHP_SELF = $_SERVER['PHP_SELF']; } $dbhost="localhost"; $dbusername="user"; $dbpassword="password"; $dbname="hesla_test"; //Before you can perform any operation on a database you must connect to the MySQL server. The syntax for performing this operation is simple: $connect = mysql_connect($dbhost, $dbusername, $dbpassword); mysql_select_db($dbname,$connect) or die ("Could not select database"); $result = mysql_query("SELECT * FROM 3gp LIMIT 10 ORDER BY id ",$connect); while($r = mysql_fetch_assoc($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $id=$r["id"]; $name=$r["name"]; $details=$r["details"]; $url=$r["url"]; $image=$r["image"]; $embede=$r["embede"]; $mirrorimg=$r["mirrorimg"]; $mirror3gp=$r["mirror3gp"]; ?> <rss version="2.0"> <channel> <title>3GP VIDEOS</title> <link>http://funxy.com</link> <description>Latest 3GP Videos</description> <language>en-us</language> <copyright>Copy Right Resereved 2009-10</copyright> <image> <url>http://www.funxy.com/images/Untitled-1_01.gif</url> <title>Latest 3GP Videos @ Funxy.Com</title> <link>http://funxy.com</link> <width>114</width> <height>54</height> </image> <item> <title><?php echo "$name"; ?></title> <link><?php echo "http://funxy.com/beta/3gp-downloads$id.html"; ?></link> <description><?php echo "$details"; ?> </description> </item> </channel> </rss> Link to comment https://forums.phpfreaks.com/topic/152060-solved-rss-using-php/ Share on other sites More sharing options...
PHP Monkeh Posted April 1, 2009 Share Posted April 1, 2009 You haven't ended the while() loop. Put: <?php } ?> at the end of your current code. Link to comment https://forums.phpfreaks.com/topic/152060-solved-rss-using-php/#findComment-798531 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.