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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with signle quote..

Status
Not open for further replies.

Elliott3

Programmer
Joined
Sep 5, 2002
Messages
347
Location
CA
The following is giving me a problem if the variable $pdfFile has a single quote in it like myPDF's.pdf. However, as long as the pdf's name does not have a single quote in it it runs fine?

<META HTTP-EQUIV=REFRESH CONTENT=&quot;0; URL=../db/<?php echo $pdfFile; ?>&quot;>

Any ideas?

CES
 
your example does not have an opening double quote...is this correct for the real version?

Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
The opening double quote is right before the '0' and the closing is right before the closing carrot.

The single quote will sometimes be in the variable $pdfFile...Any other thoughts?

This is driving me nuts!!

CES
 
can this be changed to

echo &quot;<META HTTP-EQUIV=REFRESH CONTENT=\&quot;0; URL=../db/&quot;.$pdfFile.&quot;\&quot;>&quot;;

Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
Tahnk you for your reply...however I have already tried that. I am interested in any other suggestions that you may have though!


CES
 
I am surprised that this is proving to be a hard one to figure out. Of course i have delt with embeded quotes many times before.

CES
 
NICE!!

Though it took a while, i solved my problem. Figured the problem out as soon as i started looking into the %20 code for a space in a url.

For this problem you can simply use the rawurlencode() function and it will convert the special characters for you.


Thanks for the attempts!!

CES
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top