parse error, unexpected T_STRING

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Idledaylight
Forum Newbie
Posts: 5
Joined: Wed May 19, 2004 1:18 pm

parse error, unexpected T_STRING

Post 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);
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Request() isn't a function.. I believe you are looking for $_REQUEST["whatever you're searching for"]
Idledaylight
Forum Newbie
Posts: 5
Joined: Wed May 19, 2004 1:18 pm

Post by Idledaylight »

Thanks a lot, problem solved.

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

Thanks again,

Josh
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

and I couldnt agree more.

Dreamweaver is a nasty thing, mysell call it a virus.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'd have to add Frontpage to that too tim. :)
Post Reply