abcdabcd Posted March 17, 2008 Share Posted March 17, 2008 I hope nobody is going to get upset over these questions, I don't know anything about php a website designer built this site and I'm having to make minor modifications. I have an "error" page if somebody doesn't enter a promo code on the site. Right now it just says, "Please enter your promo code." on the left side. I want to change the font and center it and/or upload an image. I did some searching online and saw that it's the same code as html which I tried but then I got an error on line 1. I'll paste both codes the top one is the original code and 2nd one is the code I tried to modify to insert an image. original code: <? $promoform = $_POST['promoform']; if($promoform == ""){ die("Please enter your promo code."); } else { header("Location: http://xxxxx.com/xxxx?sub=$promoform"); } ?> modified code that I tried: <? $promoform = $_POST['promoform']; if($promoform == ""){ die("Please enter your promo code.") <img src="http://www.xxxx.net/images/cellphone_2_01.jpg" height="122" width="160" align="middle" border="0" /> ; } else { header("Location: http://x.azjmp.com/0jn8z?sub=$promoform"); } ?> Thanks Link to comment https://forums.phpfreaks.com/topic/96468-quick-questions-with-php/ Share on other sites More sharing options...
thomashw Posted March 17, 2008 Share Posted March 17, 2008 I don't see a difference? Other than the URL. Link to comment https://forums.phpfreaks.com/topic/96468-quick-questions-with-php/#findComment-493733 Share on other sites More sharing options...
abcdabcd Posted March 17, 2008 Author Share Posted March 17, 2008 sorry it seems the forum code is removing it <? $promoform = $_POST['promoform']; if($promoform == ""){ die("Please enter your promo code.") <img src="hxxp://www.xxxx.net/images/xxxxx_2_01.jpg" height="122" width="160" align="middle" border="0" /> ; } else { header("Location: http://x.azjmp.com/0jn8z?sub=$promoform"); } ?> Link to comment https://forums.phpfreaks.com/topic/96468-quick-questions-with-php/#findComment-493741 Share on other sites More sharing options...
thomashw Posted March 17, 2008 Share Posted March 17, 2008 Try this: $promoform = $_POST['promoform']; if($promoform == "") { die("Please enter your promo code.") echo '<img src="hxxp://www.xxxx.net/images/xxxxx_2_01.jpg" height="122" width="160" align="middle" border="0" />'; } else { header("Location: http://x.azjmp.com/0jn8z?sub=$promoform"); } Link to comment https://forums.phpfreaks.com/topic/96468-quick-questions-with-php/#findComment-493745 Share on other sites More sharing options...
nibbo Posted March 17, 2008 Share Posted March 17, 2008 If the image is to be output in the 'die' statement then it needs to be in the quoted/bracketed part. I.e.: die("Please enter your promo code. <img src='hxxp://www.xxxx.net/images/xxxxx_2_01.jpg' height='122' width='160' align='middle' border='0' />"); Note thet all of the quotes in the image tag need to be single quotes. Link to comment https://forums.phpfreaks.com/topic/96468-quick-questions-with-php/#findComment-493775 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.