lpxxfaintxx Posted March 13, 2006 Share Posted March 13, 2006 [code]<?phprequire_once "maincore.php";require_once "subheader.php";require_once "side_left.php";$imageid= $_GET["id"];$result = mysql_query("SELECT * FROM files WHERE id=$imageid"); $myrow = mysql_fetch_array($result); ?><html><center><img src="<?php echo $myrow["idpath"]; ?>"/></center><br /><center><table width="551" height="54" border="1"> <tr> <td><?php echo $myrow["description"];?></td> </center>Description: </tr></table></center><a href="nfndf">dndnf</a><br /><br /><center> <p> </p> <p>Share With Your Friends!</p></center>HTML: <input type="text" name="thetext" size="80" value="<a href="http://starcraftarena.roxr.com/fusion/"><img src="<?php echo $myrow["idpath"]; ?></a>"><Br />BBCODE: <input type="text" name="thetext" size="80" value="[url=http://starcraftarena.roxr.com/fusion/][img]<?php echo $myrow["idpath"]; ?>[/img][/url]"><br />AIM Profile: <input name="thetext" type="text" value="<a href="http://starcraftarena.roxr.com/fusion/viewimage.php?id=<?php echo $myrow["id"]?>">HELLO</a>" size="80" /><Br /></html><?phprequire_once "side_right.php";require_once "footer.php";?>[/code]Before I even tried testing the script, I know its not gonna work.[code]AIM Profile: <input name="thetext" type="text" value="<a href="http://starcraftarena.roxr.com/fusion/viewimage.php?id=<?php echo $myrow["id"]?>">HELLO</a>" size="80" />[/code]There are 2 quotes ( " ) so it obviously wont work. Same with line 25. Is there any way around this? Quote Link to comment Share on other sites More sharing options...
toplay Posted March 13, 2006 Share Posted March 13, 2006 You should have tried it before posting because I don't see any syntax problems. Why do you think there's a problem with double quotes?The code shown is primarily in HTML mode with occasionally echoing PHP data. You're fine. Quote Link to comment Share on other sites More sharing options...
lpxxfaintxx Posted March 13, 2006 Author Share Posted March 13, 2006 Thats not the problem. I am trying to make a "imageshack" clone, where after you upload the file the html code or bbcode appears.The bbcode comes out fine, but the ones with 2 quotes come out like this: [a href=\"http://starcraftarena.roxr.com/fusion/viewimage.php?id=30\" target=\"_blank\"]http://starcraftarena.roxr.com/fusion/viewimage.php?id=30[/a] Quote Link to comment Share on other sites More sharing options...
sgb162 Posted March 13, 2006 Share Posted March 13, 2006 Try changing [code]<input name="thetext" type="text" value="<a href="http://starcraftarena.roxr.com/fusion/viewimage.php?id=<?php echo $myrow["id"]?>">HELLO</a>" size="80" />[/code]to[code]<input name="thetext" type="text" value="<a href="http://starcraftarena.roxr.com/fusion/viewimage.php?id=<?php echo $myrow["id"]; ?>">HELLO</a>" size="80" />[/code]and see what happens. Quote Link to comment Share on other sites More sharing options...
lpxxfaintxx Posted March 13, 2006 Author Share Posted March 13, 2006 Nope, same exact thing. Quote Link to comment Share on other sites More sharing options...
toplay Posted March 13, 2006 Share Posted March 13, 2006 Use single quotes:[!--html--][div class=\'htmltop\']HTML[/div][div class=\'htmlmain\'][!--html1--]<[color=blue]input name[/color]="[color=orange]thetext[/color]" type="[color=orange]text[/color]" size="[color=orange]80[/color]" value='[color=orange]<[span style=\'color:blue\']a href[/color]="http://starcraftarena.roxr.com/fusion/viewimage.php?id=<?php echo $myrow["id"]; ?>[/span]">HELLO<[color=blue]/a[/color]>'/>[!--html2--][/div][!--html3--] Quote Link to comment Share on other sites More sharing options...
phporcaffeine Posted March 13, 2006 Share Posted March 13, 2006 Ahhh PHP and quotes - they play so nice togetherGeneral Rules Of ThumbIn PHP:When echoing you should always try to use echo " " The dbl quotes allow for variable evaluation inside the echo whereas echo ' ' would return a literal echo.If your echo requires the echoing of a dbl quote you MUST precced it with a '\' deliminator.When echoing an array element outside of an echo use single quotes $my_array['element']When echoing an array element inside an echo you don't want ANY quotes echo "$my_array[element]"If your array is keyed with an int Vs. text then you NEVER use quotes of any type. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.