php guru help please

John Dangler jdangler at atlantic.net
Sat Dec 23 02:31:30 UTC 2006


It appears as if those marks indicate a transaction block of some sort,
although I can't find any reference to it anywhere on php.net
And, never having seen them used in php before, I would say that the
error is truly a "syntax error" ...

but why not something like this -
if ($del == "Yes") 
{
  ?>
    <p> User <? echo $fname . ' ' . $lname ?> with user name $uname has
        been deleted</p>
    <br>
    <br>
    <a href="./userlist.php">Back to User List</a>
  <?
  echo $yes;
}

On Fri, 2006-12-22 at 21:13 -0500, Qiuli Han wrote:
> Hi php, sorry, ubuntu:
> i know this is not right place to ask, but i am running LAMP on an
> ubuntu 6.01
> so i have some code here in php gives me problem:
> 
> Parse error: syntax error, unexpected $end
> in /srv/www/htdocs/php/store/userdelGO.php on line 68
> 
> well
> from experience i know it must be =<<< caused the problem
> since if i comment out those 2 =<<< in my if statements it wont have
> any problem 
> 
> then i try to fix that =<<< problem
> but no matter what i do it just.....u know....same error
> 
> here is my stupid code
> open.php is the file i use to open the mysql connection
> 
> please help
> 
> thanks
> 
> <?php
> 
> $id=$_REQUEST['id'];
> $del=$_REQUEST['del'];
> echo $id;
> include "open.php";
> 
> $query="select user_name, fname, lname from user where id=$id"; 
> 
> $run=mysql_query($query) or die (mysql_error());
> 
> $row = mysql_fetch_array($run,MYSQL_ASSOC);
> 
> $uname=$row['user_name'];
> $fname=$row['fname'];
> $lname=$row['lname'];
> 
> 
> 
> 
> if ($del == "Yes") {
> //echo "yes";    
>     //mysql_query(delete from user where id=$id);
> 
> $yes=<<<QEW
>         <html>
>         <title>Confirmation</title> 
>         <body>
>         <p> User $fname $lname with user name $uname has been
> deleted</p>
>         <br>
>         <br>
>         <a href="./userlist.php">Back to User List</a> 
>         </body>
>         </html>
>     QEW;
> 
>     
>     echo $yes;
> 
> }
> 
> 
> 
> if ($del == "No") {
> echo "no";
> /*
>     $no=<<<EOD
>                 <html> 
>                 <title>Confirmation</title>
>                 <body>
>                 <p> You cancelled deleting user $fname $lname with
> User name $uname</p>
>                 <br> 
>         <p> User $fname stays in the database</p>
>                 <br>
>                 <a href="./userlist.php">Back to User List</a>
>                 </body>
>                 </html> 
>         EOD;
>         echo $no;
> */
> }
> 
> mysql_close();
> 
> ?>





More information about the ubuntu-users mailing list