Page 1 of 1

parse area - printing variables in single quotes?

Posted: Mon Jun 02, 2003 6:23 am
by jarow
I get the parse error: unexpected T_VARIABLE, expecting ',' or ';' when I try to run this code.

Code: Select all

<?php
echo str_repeat("<dd>",$i++).'<a href="$_REQUEST['user']._detail.php?user=$_REQUEST['user']"><font color="#003366"><i>';
?>
Any ideas on what is wrong?

thanks

Posted: Mon Jun 02, 2003 6:26 am
by []InTeR[]
Try this: (not tested)

Code: Select all

<?php 
echo str_repeat("<dd>",$i++)."<a href="".$_REQUEST&#1111;'user']._detail.php?user=$_REQUEST&#1111;'user'].""><font color="#003366"><i>"; 
?>

Posted: Mon Jun 02, 2003 6:49 am
by jarow
Thanks

I get this error response with your suggestion:

Parse error: parse error, unexpected '=' in

Posted: Mon Jun 02, 2003 6:53 am
by twigletmac
Start by reading this:
http://php.net/manual/en/language.types.string.php

Then try this:

Code: Select all

<?php 
echo str_repeat('<dd>', $i++).'<a href="'.$_REQUEST['user'].'_detail.php?user='.$_REQUEST['user'].'"><font color="#003366"><i>'; 
?>
Mac