Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quotes probs

Status
Not open for further replies.

boab

Programmer
May 30, 2001
75
0
0
GB
can anyone help (please!) have located the problem in a script and narrowed it down to the line below any Ideas

echo &quot;<input type=hidden name=productId
value='&quot;. $product[&quot;productId &quot;].&quot;'>&quot;;

think it's something to do with escaping the quotes

Cheers
 
Try
echo &quot;<input type=hidden name=productId
value=\&quot;&quot; . $product[&quot;productId &quot;] . &quot;\&quot;>&quot;; //Daniel
 
the quotes are a huge pain.

That solution doesn't solve your problem.

You have to change all the quotes in the var to HTML code.

echo &quot;<input type=hidden name=productId
value=\&quot;&quot; . str_replace(&quot;\&quot;&quot;,&quot;&quot;e;&quot;,$product[&quot;productId &quot;]) . &quot;\&quot;>&quot;;

but make sure you don't have HTML code, or that the change of the quotes doesn't screw up your code. If the codes are only for text purpose, it's ok, you can use this piece of code.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
tried both of those guys the first does just the same as the code I hade to start with. The second generates a parse error. The problem I had with the original is that the actual tag is generated no problem but the tag value is empty any ideas?
 
rats ... sorry ... this thing changed the HTML code


the replace is to &quote; Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
try this
echo &quot;<input type=hidden name=productId value=\&quot;{$product[&quot;productId &quot;]}\&quot;>&quot;;
 
A silly question.

What does the brackets?

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
I'm getting tired of this...

Quotes=Amperstamp followed by quote;

Code:
str_replace(&quot;\&quot;&quot;,Quotes,$string);

Let see if now this guy shows what i want...
Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Anikin, I tried the last idea i take it that it is implemented as
echo &quot;<input type=hidden name=productId
value=\&quot;&quot; . str_replace(&quot;\&quot;&quot;,quotes,$product[&quot;productId &quot;]) . &quot;\&quot;>&quot;;

is that right? If so it doesn't work, no parse errors but doesn't get the value of $product[&quot;product&quot;]to the next page
 
it passes as $productId.

Is the input tag between the form tags?

This is a stupid thing, send me an e-mail to hugo@mni.pt and i'll send you the right code.

P.S. This is my e-mail at work, and i only work till Friday 6 pm GMT, so if your e-mail arrives later ... only next year. I'll be on holidays. Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top