Page 1 of 1

damn unexpected T_Variable!

Posted: Wed Apr 19, 2006 6:44 pm
by bruceg
I am getting an unexpected T_VARIABLE error on line 21 of the following script. I can't pick out the error. Can anyone assist?

Code: Select all

<?php

if (!$_POST['id']) {

header ( "Location: http://www.inspired-evolution.com/pick_delcontact.php");

exit;

} 

else {

session_start();

}

if ($_SESSION['valid'] !="yes") {

header ("Location: http://www.inspired-evolution.com/Recruiters.php");

exit;

}

$db_name = "data_base";

$table_name ="table";

$connection = @mysql_connect("localhost", "foo", "bar") or die(mysql_error());

$db = @mysql_select_db($db_name, $connection) or die(mysql_error());

$sql = "SELECT f_name, l_name, address1, address2, city, postcode, country, prim_tel, sec_tel, email, company, last_updated

FROM $table_name WHERE id ='$_POST[id]'";

$result = @mysql_query($sql ,$connection) or die(mysql_error());

while ($row = mysql_fetch_array($result)) {

$f_name $row['f_name'];

$l_name $row['l_name'];

$address1 $row['address1'];

$address2 $row['address2'];

$address3 $row['city'];

$postcode $row['postcode'];

$country $row['country'];

$prim_tel $row['prim_tel'];

$sec_tel $row['sec_tel'];

$email $row['email'];

$company $row['company'];

$last_updated $row['last_updated'];

}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">

<head>

<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" />

<title>Inspired Evolution : : Pick a recruiter</title>

<link rel="shortcut icon" href="http://www.inspired-evolution.com/favicon.ico" />

<?php require('includes/meta_tags.inc'); ?>

<link rel="stylesheet" href="Gilbert.css" type="text/css" media="screen, handheld" />

<link rel="stylesheet"

type="text/css"

media="print" href="print.css" />

</head>

<body>



<!-- begin outer wrapper div --> 

<div id="wrapper_outer">

<a class="skiplink" href="#startcontent">Skip over navigation</a>

<!-- begin header div --> 

<div id="header"><?php require ('rotate.php'); ?><?php showImage () ;?></div>

<!-- top nav list --> 

<div id="navcontainer">

<?php require ('includes/menu.php');?>

</div>

<!-- inner content wrapper div --> 

<div id="wrapper_inner">

<!-- breadcrumbs div --> 

<div id="breadcrumbs"><a href="index.php" title="home link" accesskey="h">Home</a> > > Delete a Recruiter</div>

<!-- text div --> 

<div id="main_content">

<!-- old browser help -->

<div class="hide">

<p>This site has been designed to look in best in a browser that supports <a href="http://www.webstandards.org/upgrade/" 

title="Download a browser that complies with Web standards.">web standards</a>.</p>

</div>

<h1 title="Delete a recruiter">Delete a Recruiter</h1>

<a name="startcontent" id="startcontent"></a>

<?php require('includes/icons.php'); ?>

<form method=\"post\" action=\"do_delcontact.php\">

<fieldset>

<legend>Delete the selected recruiter</legend>

<input type=\"hidden\" name=\"id\" value="<?php echo "$_POST['id']"; ?>">

<input type=\"hidden\" name=\"f_name\" value="<?php echo "$f_name"; ?>">

<input type="hidden" name=\"l_name\" value="<?php echo "$l_name"; ?>">

<table id=\"recruiters_list\">

<tr>

<th>Name & Address Information</th>

<th>Other / Personal Contact Information</th>

</tr>

<tr>

<td valign=\"top\">

<table id=\"recruiter_list\" summary=\"list of local technical recruiters\" cellspacing=\"0\">

<tr>

<th>Name & Address Information</th>

<th>Other Contact / Personal Information</th>

</tr>

<tr>

<td valign=\"top\">

<label for=\"first_name\">First Name:</label><br /><br />

<? echo "$_POST[f_name]"; ?><br /><br />

<label for=\"last_name\">Last Name:</label><br /><br />

<? echo "$_POST[l_name]"; ?><br /><br />

<label for=\"Address1\">Address Line 1:</label><br /><br />

<? echo "$_POST[address1]"; ?><br /><br />

<label for=\"Address2\">Address Line 2:</label><br /><br />

<? echo "$_POST[address2]"; ?><br /><br />

<label for=\"city\">City:</label><br /><br />

<? echo "$_POST[city]"; ?><br /><br />

<label for=\"Zip\">Zip/Postal Code:</label><br /><br />

<? echo "$_POST[postcode]"; ?><br /><br />

<label for=\"Country\">Country:</label><br /><br />

<? echo "$_POST[country]"; ?><br /><br />

</td>

<td valign=\"top\">

<label for=\"primary_phone\">Primary Telephone Number:</label><br /><br />

<? echo "$_POST[prim_tel]"; ?><br /><br />

<label for=\"secondary_phone\">Secondary Telephone Number:</label><br /><br />

<? echo "$_POST[sec_tel]"; ?><br /><br />

<label for=\"email\">E-mail Address:</label><br /><br />

<? echo "$_POST[email]"; ?><br /><br />

<label for=\"Company\">Company</label><br /><br />

<? echo "$_POST[company]"; ?><br /><br />

<label for=\"last_updated\">Last Update</label><br /><br />

<? echo "$_POST[last_updated]"; ?><br /><br />

</td>

</tr>

<tr>

<td align=\"center\" colspan=\"2\">

<p><input type=\"submit\" name=\"submit\" value=\"delete this recruiter\"></p>

<p><a href="Recruiters.php">Return to Main Menu</a></p>

</td>

</tr>

</table>

</fieldset>

</form>

<?php require('includes/footer_tag.php') ; ?>

<?php require('includes/redirect.php'); ?>

</div>

<!-- begin footer --> 

<div id="footer">



<?php require('includes/footer.inc'); ?>

<span class="date"><?

$last_modified = filemtime("Hireme.php");

print("Last Modified ");

print(date("m/j/y h:i", $last_modified));

?></span>

</div>

</div>

</div>

</body>

Re: damn unexpected T_Variable!

Posted: Wed Apr 19, 2006 7:13 pm
by Nathaniel

Code: Select all

$f_name $row['f_name'];

$l_name $row['l_name'];

$address1 $row['address1'];

$address2 $row['address2'];

$address3 $row['city'];

$postcode $row['postcode'];

$country $row['country'];

$prim_tel $row['prim_tel'];

$sec_tel $row['sec_tel'];

$email $row['email'];

$company $row['company'];

$last_updated $row['last_updated'];
All of those need to be changed to "$f_name = $row['f_name'];".