GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 15-Jul-2006, 13:08
sph2005 sph2005 is offline
New Member
 
Join Date: Jul 2006
Posts: 6
sph2005 is on a distinguished road

Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


Sorry everyone for bringing this to the fore again . I have Googled it to death and also tried many of the suggestions supplied in this forum . Been trying to fix this for 3 entire days with no luck . I am using Dreamweaver with Mysql to try and make a very simple form for a DVD movie database . Dreamweaver produces all the code . Here is the error I get on clicking the submit button :

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /hsphere/local/home/lgmarina/losgigantesapartments.net/results10.php on line 13

and the first 20 lines of code :

PHP Code:

<?php $westerns = $_GET['westerns']; ?>
<?php require_once('Connections/connmovies.php'); ?>
<?php

$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

$westerns_Recordset1 = "0";
if (isset(form.variable ("westerns"))) {;
  $westerns_Recordset1 = (get_magic_quotes_gpc()) ? form.variable ("$westerns") : addslashes(form.variable ("$westerns"));
}
mysql_select_db($database_connmovies, $connmovies);
$query_Recordset1 = sprintf("SELECT * FROM movies WHERE %s = %s AND comedy = comedy AND childrens = childrens AND action = action AND drama = drama AND sciencefiction = sciencefiction AND musical = musical", $westerns_Recordset1,$westerns_Recordset1);
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connmovies) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);


I am very new to this so if it is a blaringly obvious mistake I apologise in advance .

Thank you
  #2  
Old 15-Jul-2006, 15:15
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


What is the semi-colon after the '{' behind "westerns" ??
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #3  
Old 16-Jul-2006, 06:42
sph2005 sph2005 is offline
New Member
 
Join Date: Jul 2006
Posts: 6
sph2005 is on a distinguished road

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


Quote:
Originally Posted by TurboPT
What is the semi-colon after the '{' behind "westerns" ??

Thank you for the reply . If this is an error in the code removing it has made no difference as the error message persists :

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /hsphere/local/home/lgmarina/losgigantesapartments.net/results10.php on line 13
  #4  
Old 16-Jul-2006, 08:51
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


That was just the first thing that seemed odd, but the error is still complains about line 13, which is the same line, so...

Taking a clue from the error (the or '$' part), on the same line, should "westerns" have the '$' (checking the form variable)?
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #5  
Old 16-Jul-2006, 09:25
sph2005 sph2005 is offline
New Member
 
Join Date: Jul 2006
Posts: 6
sph2005 is on a distinguished road

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


Quote:
Originally Posted by TurboPT
That was just the first thing that seemed odd, but the error is still complains about line 13, which is the same line, so...

Taking a clue from the error (the or '$' part), on the same line, should "westerns" have the '$' (checking the form variable)?

Same as before , sorry . If this code is so far out , do you happen to know if Dreamweaver is responsible for generating these mistakes ?
  #6  
Old 16-Jul-2006, 09:43
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


If you comment-out that entire if check, does the error still appear?
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #7  
Old 16-Jul-2006, 10:11
sph2005 sph2005 is offline
New Member
 
Join Date: Jul 2006
Posts: 6
sph2005 is on a distinguished road

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


No . But it then throws up this instead :

Fatal error: Call to undefined function: variable() in /hsphere/local/home/lgmarina/losgigantesapartments.net/results10.php on line 16
  #8  
Old 16-Jul-2006, 10:29
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


This might be silly to ask, but for your *_Recordset1 variables, the western one is set to "0", and the others to a number (one has 0, the other 10), what is the difference? (thinking about the unexpected t_string)
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #9  
Old 16-Jul-2006, 11:05
sph2005 sph2005 is offline
New Member
 
Join Date: Jul 2006
Posts: 6
sph2005 is on a distinguished road

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


Sorry Turbo . I can see the certain disparity there but I don't know for sure what the significance of means . This is day 4 of staring at this monitor and my brain is turning to slush now .
  #10  
Old 16-Jul-2006, 20:58
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI


I told you my question was silly, for I see now how those are used.

I have found information implying that form values cannot be retrieved directly, rather the $_GET, $_POST, $_REQUEST must be used. (also there is a setting required in the php.ini file)

see if the last comment this bug entry (about retrieving data from forms): http://bugs.php.net/bug.php?id=22615&edit=1
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 05:30.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.