Forum Moderators: coopster
Any help is much appreciated.
Error:
unexpected T_VARIABLE in /home/content/r/e/v/revjohnny/html/testimony/index.php on line 29
Note: Line 29 is the one that starts with $contents, in my editor, that string is one line, not two as below.
Code:
<?
if ($submit == 1) {
mysql_query("INSERT INTO testimonials (fname, lname, email, text, img, url)
VALUES ('$fname', '$lname', '$email', '$text', '$img', '$url')");
$records = mysql_query('Select `id` from `testimonials`);
$num = mysql_num_rows($records);
$page = mysql_fetch_array($records);
$pagenumber = $page[id][$num];
print $pagenumber."<br><br>";
$pageid = "testimonial".$pagenumber.".php";
$file=fopen("$pageid","w");
$contents="<" . "? \$fname = '$fname'; \$lname='$lname'; \$text = '$text'; \$img='$img'; \$url='$url'; include(\"display.php\");?" . ">";
fwrite($file,$contents);
fclose($file);
print "Thank you, $fname, now please read our other testimonials.";
print "<br><br>";
$result = mysql_query('SELECT * FROM `testimonials` WHERE `active` = 1 ORDER BY `rank` ASC');
while($row = mysql_fetch_array($result)) {
print "<a href='http://example.com/testimony/testimonial$row[id].php'><font face='arial' color='#ffffff' size='3'><b>$row[fname] $row[lname]</b></font></a><br>";
};
} else {
$result = mysql_query('SELECT * FROM `testimonials` WHERE `active` = 1 ORDER BY `rank` ASC');
while($row = mysql_fetch_array($result)) {
print "<a href='http://example.com/testimony/testimonial$row[id].php'><font face='arial' color='#ffffff' size='3'><b>$row[fname] $row[lname]</b></font></a><br>";
};
};?>
[edited by: eelixduppy at 11:13 pm (utc) on Feb. 6, 2008]
[edit reason] example.com [/edit]
- Having trouble finding it?
It's located underneath you're name (<<-- over there) between the " User Profile " and " Sticky Mail " buttons.
[edited by: GamingLoft at 11:12 pm (utc) on Feb. 6, 2008]