Jump to content

[SOLVED] syntax error


adzie

Recommended Posts

Hello,

 

Currently I have this

 

<td><a href="<?=$_SERVER['php_SELF']?>?page=<?=$pageNum?>&group=<?=$group?>&order=name&list=<?=$list?>">name</a></td>

 

but trying to put it into php i get the error

 

echo '<td><a href="<?=$_SERVER['php_SELF']?>?page=<?=$pageNum?>&group=<?=$group?>&order=name&list=<?=$list?>">name</a></td>';

 

 

syntax error, unexpected T_STRING, expecting ',' or ';'

Link to comment
https://forums.phpfreaks.com/topic/135805-solved-syntax-error/
Share on other sites

<?php
echo '<td><a href="'.$_SERVER['php_SELF'].'?page='.$pageNum.'&group='.$group.'&order=name&list='.$list.'">name</a></td>';
?>

 

 

You're trying to open and close php tags inside the script

 

also if you do use tags use the full ones;

 

<?php

 

not

 

<?

 

also i'd suggest;

 

<?php echo

 

not

 

<?=

Link to comment
https://forums.phpfreaks.com/topic/135805-solved-syntax-error/#findComment-707745
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.