Jump to content

$_get looks good


avo

Recommended Posts

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

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

as you can see or i dont there is nothing wrong

any idea please

thanks in advance.

Link to comment
Share on other sites

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

couldnt you use


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

or escape the "s
Link to comment
Share on other sites

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

line 83 is:

[code]      } ?>[/code]
Link to comment
Share on other sites

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

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

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

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

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

[code]
      <? if ($_GET['msg']){
      echo '
      <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>
      </tr>
      <tr>';
      } ?>
[/code]
[/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
[code]
phpinfo ()
[/code]
and compared the two tables that are outputed to check settings and both are the same .

ummmmmmmmmmmmm!

all help greatly appriciated .


Thanks in advance.
Link to comment
Share on other sites

[!--quoteo(post=378977:date=Jun 1 2006, 09:55 AM:name=avo)--][div class=\'quotetop\']QUOTE(avo @ Jun 1 2006, 09:55 AM) [snapback]378977[/snapback][/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?
Link to comment
Share on other sites

[!--quoteo(post=378980:date=Jun 1 2006, 09:03 AM:name=Honoré)--][div class=\'quotetop\']QUOTE(Honoré @ Jun 1 2006, 09:03 AM) [snapback]378980[/snapback][/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 .

Link to comment
Share on other sites

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

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

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

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

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

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

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

i then changed it to

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

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.
Link to comment
Share on other sites

[!--quoteo(post=379002:date=Jun 1 2006, 10:26 AM:name=Honoré)--][div class=\'quotetop\']QUOTE(Honoré @ Jun 1 2006, 10:26 AM) [snapback]379002[/snapback][/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.
Link to comment
Share on other sites

[!--quoteo(post=379003:date=Jun 1 2006, 11:30 AM:name=avo)--][div class=\'quotetop\']QUOTE(avo @ Jun 1 2006, 11:30 AM) [snapback]379003[/snapback][/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:
[code]
<? if ($_GET['msg']=='0'){
      echo '<td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td></tr><tr>';
} ?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.