Page 1 of 1

parse error, unexpected T_STRING

Posted: Wed May 19, 2004 1:18 pm
by Idledaylight
The following code was generated by Dreamweaver MX(I am 100% sure that the WYSIWYG interface was done correctly), so I am clueless as what to do. I receive the following error:

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in c:\inetpub\wwwroot\day 13\verify.php on line 4

I tried substituting the variables $varUsername and $varPassword in the place of the Request(...) inside the isset function calls and that just got me a new error.

Fatal error: Call to undefined function: request() in c:\inetpub\wwwroot\day 13\verify.php on line 5

I realize its a longshot, but if someone can help me I would greatly appreciate it.

Thanks,

Josh

Code: Select all

<?php require_once('Connections/connDay13.php'); ?>
<?php
$varUsername_Recordset1 = "test";
if (isset(Request("username"))) {
  $varUsername_Recordset1 = (get_magic_quotes_gpc()) ? Request("username") : addslashes(Request("username"));
}
$varPassword_Recordset1 = "test";
if (isset(Request("password"))) {
  $varPassword_Recordset1 = (get_magic_quotes_gpc()) ? Request("password") : addslashes(Request("password"));
}
mysql_select_db($database_connDay13, $connDay13);
$query_Recordset1 = sprintf("SELECT * FROM tbluserinfo WHERE tbluserinfo.username='%s' AND password='%s';", $varUsername_Recordset1,$varPassword_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $connDay13) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>

Posted: Wed May 19, 2004 1:28 pm
by feyd
Request() isn't a function.. I believe you are looking for $_REQUEST["whatever you're searching for"]

Posted: Wed May 19, 2004 1:41 pm
by Idledaylight
Thanks a lot, problem solved.

Would you happen to have any idea why Dreamweaver would generate incorrect code?

Thanks again,

Josh

Posted: Wed May 19, 2004 2:08 pm
by Weirdan
Idledaylight wrote: Would you happen to have any idea why Dreamweaver would generate incorrect code?
Because Dreamweaver isn't a programmer ;)

Seriously, write the code yourself.

Posted: Wed May 19, 2004 5:09 pm
by tim
and I couldnt agree more.

Dreamweaver is a nasty thing, mysell call it a virus.

Posted: Wed May 19, 2004 5:17 pm
by feyd
I'd have to add Frontpage to that too tim. :)