Jump to content


Photo

$_get looks good


  • Please log in to reply
12 replies to this topic

#1 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 01 June 2006 - 06:33 AM

HI all

can anyone please help me out here.

i rent a server with sql db and my code all works good
ive just setup apache which i have done lots of times ive copeyd all my table information and placed it into my new db (one installed on my local pc)

set up my config files to match the db its pulling from

but get an error !! error is

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: parse error, unexpected ';' in C:\wamp\www\member\delete_user.php on line 79[/quote]

this is line 79

   echo ?>
          <? if ($_GET['msg']){
      echo ?>
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>
      <? } ?>

as you can see or i dont there is nothing wrong

any idea please

thanks in advance.


Im loving it ........

#2 kripz

kripz
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 01 June 2006 - 06:46 AM

          <? if ($_GET['msg']){
      echo ?>
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>
      <? } ?>

couldnt you use


<?php 
if ($_GET['msg'])
{
echo '<td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete !</strong></td></tr><tr>';
} 
?>

or escape the "s

#3 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 01 June 2006 - 06:51 AM

HI thanks

that was my thought as well but then you get this error

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: parse error, unexpected '}', expecting ',' or ';' in C:\wamp\www\member\delete_user.php on line 83[/quote]
      <? if ($_GET['msg']){
      echo '
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>'
      } ?>

line 83 is:

      } ?>

Im loving it ........

#4 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 01 June 2006 - 07:05 AM

Use the code from kripz, that one is working.

Your code is wrong, you have a missing ; character

#5 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 01 June 2006 - 07:20 AM

      <? if ($_GET['msg']){
      echo '
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>'
      } ?>

The problem with this is that you are missing the semicolon on line 82

      <? if ($_GET['msg']){
      echo '
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>';
      } ?>


#6 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 01 June 2006 - 07:55 AM

[!--quoteo(post=378969:date=Jun 1 2006, 08:20 AM:name=GingerRobot)--][div class=\'quotetop\']QUOTE(GingerRobot @ Jun 1 2006, 08:20 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
      <? if ($_GET['msg']){
      echo '
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>'
      } ?>

The problem with this is that you are missing the semicolon on line 82

      <? if ($_GET['msg']){
      echo '
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>';
      } ?>
[/quote]


Hi thanks

Thats my sleepy head this morning

ok ive now tryed what you suggested but still the same error

cant understand why its ok on my payed server but not my local server ive even done
phpinfo () 
and compared the two tables that are outputed to check settings and both are the same .

ummmmmmmmmmmmm!

all help greatly appriciated .


Thanks in advance.
Im loving it ........

#7 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 01 June 2006 - 08:03 AM

[!--quoteo(post=378977:date=Jun 1 2006, 09:55 AM:name=avo)--][div class=\'quotetop\']QUOTE(avo @ Jun 1 2006, 09:55 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
ok ive now tryed what you suggested but still the same error
[/quote]
You get the same error at the same line with the same PHP statement? Weird!

And you are sure that exactly the same script, with the missing ; character worked without errors on the payed server?

#8 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 01 June 2006 - 08:31 AM

[!--quoteo(post=378980:date=Jun 1 2006, 09:03 AM:name=Honoré)--][div class=\'quotetop\']QUOTE(Honoré @ Jun 1 2006, 09:03 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
You get the same error at the same line with the same PHP statement? Weird!

And you are sure that exactly the same script, with the missing ; character worked without errors on the payed server?
[/quote]


i did not try that on the payed server but without ' and ' the code works fine when echoing the html on the payed server but not the one installed on local machine

i tryed the above code on the local machine adding ; at the end also adding echo 'html code'; }

very strainge as you can see all that is on that line is echo ?> no ; pressent at all

and thats what the error is reporting when echoing html with ' ' reporing } should not be there but it should

Cheers for all the help keep it coming .


Im loving it ........

#9 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 01 June 2006 - 08:52 AM

1) This is the code you showed initally, and I think this code never worked:
<? if ($_GET['msg']){
      echo ?>
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>
      <? } ?>

2) Hereafter you have code without echo statement. This code probably will work:
<? if ($_GET['msg']){ ?>
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>
      <? } ?>

3) And finally the code with the echo statement. This one should work also:
<? if ($_GET['msg']){
      echo '
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>';
      } ?>


#10 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 01 June 2006 - 09:10 AM

[!--quoteo(post=378993:date=Jun 1 2006, 09:52 AM:name=Honoré)--][div class=\'quotetop\']QUOTE(Honoré @ Jun 1 2006, 09:52 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
1) This is the code you showed initally, and I think this code never worked:
<? if ($_GET['msg']){
      echo ?>
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>
      <? } ?>

2) Hereafter you have code without echo statement. This code probably will work:
<? if ($_GET['msg']){ ?>
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>
      <? } ?>

3) And finally the code with the echo statement. This one should work also:
<? if ($_GET['msg']){
      echo '
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>';
      } ?>
[/quote]


my misstakes sorry im at work trying to do one thing and also trying to find a solution for my hobbie

they all would have had echo in them

ok this code works on my paid server but not on my local machine error at line echo ?> saying there was a ; pressent but as you can see there is not

<? if ($_GET['msg']=='0'){
      echo ?>
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>
      <? } ?>

i then changed it to

<? if ($_GET['msg']=='0'){
      echo ' ?>
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>';
      <? } ?>

worked on my paid server but not on my local machine saying parse error and pointing to <? } ?> and it should not be there but it should.

these as now been copyed from the files running on the servers so no mistakes this time.

hope i have explaned a little better this time

cheers again.

Im loving it ........

#11 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 01 June 2006 - 09:26 AM

Sorry but for me both code fragments in your post #10 have errors and therefore it is normal that you get warning messages when you try to run them.

#12 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 01 June 2006 - 09:30 AM

[!--quoteo(post=379002:date=Jun 1 2006, 10:26 AM:name=Honoré)--][div class=\'quotetop\']QUOTE(Honoré @ Jun 1 2006, 10:26 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Sorry but for me both code fragments in your post #10 have errors and therefore it is normal that you get warning messages when you try to run them.
[/quote]



are you getting the same errors ?

is there anything else you can think off ?

Cheers.
Im loving it ........

#13 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 01 June 2006 - 10:02 AM

[!--quoteo(post=379003:date=Jun 1 2006, 11:30 AM:name=avo)--][div class=\'quotetop\']QUOTE(avo @ Jun 1 2006, 11:30 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
is there anything else you can think off ?
[/quote]
Yes, use the code proposed by kripz in post #2 or use the following:
<? if ($_GET['msg']=='0'){
      echo '<td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td></tr><tr>';
} ?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users