Monk3h Posted April 5, 2008 Share Posted April 5, 2008 I cant figure out why when i go to the ?view=smith Link the text i inputed as a text doesnt apear :S <?php $title = "Gem Store"; include("header.php"); ?> <b>Store Owner:</b> Welcome to my store! Here you can <i>Buy</i> and <i>Sell</i> many diferent Priceless Stones..<br><br><br> <?php if ($stat[gembag] == n ) { Print "<b>Store Assistant:</b> You dont appear to have a <i>Gem Bag</i>! How do you expect to collect all the precious stones that are available in this wonderful Town?<br><br>"; Print "<b>Store Assistant:</b> Here, take this.. Its on the house, but dont get telling people we do FreeBs!<br><br>"; Print "The store Assistant hands you a <b>Small Gem Bag<br><br><br></b>"; Print "[<A href=seccity.php>Back to Town?</a>]"; mysql_query("update players set gembag='s' where id=$stat[id]"); include("footer.php"); exit; } else { Print "<b>Store Assistant:</b> How are you getting on with that <i>Small Gem Bag</i>?<br> Normally you could upgrade that tiny thing! (For a Small Fee) But right now we are out of Stock.<br><br><br>"; Print "[<A href=gemstore.php?view=smith>Visit the Gem Smith</a>] [<A href=seccity.php>Back to Town</a>]"; include("footer.php"); exit } if ($view == smith) { print "Yaaaarrrr"; include("footer.php"); exit; } ?> <?php include("footer.php"); ?> Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 5, 2008 Share Posted April 5, 2008 Change it to: if ($_GET['view'] == 'smith') { Quote Link to comment Share on other sites More sharing options...
Monk3h Posted April 5, 2008 Author Share Posted April 5, 2008 Done, now i get this Error. Parse error: syntax error, unexpected '}' in /home/monk3h/public_html/gemstore.php on line 27 <?php $title = "Gem Store"; include("header.php"); ?> <b>Store Owner:</b> Welcome to my store! Here you can <i>Buy</i> and <i>Sell</i> many diferent Priceless Stones..<br><br><br> <?php if ($stat[gembag] == n ) { Print "<b>Store Assistant:</b> You dont appear to have a <i>Gem Bag</i>! How do you expect to collect all the precious stones that are available in this wonderful Town?<br><br>"; Print "<b>Store Assistant:</b> Here, take this.. Its on the house, but dont get telling people we do FreeBs!<br><br>"; Print "The store Assistant hands you a <b>Small Gem Bag<br><br><br></b>"; Print "[<A href=seccity.php>Back to Town?</a>]"; mysql_query("update players set gembag='s' where id=$stat[id]"); include("footer.php"); exit; } else { Print "<b>Store Assistant:</b> How are you getting on with that <i>Small Gem Bag</i>?<br> Normally you could upgrade that tiny thing! (For a Small Fee) But right now we are out of Stock.<br><br><br>"; Print "[<A href=gemstore.php?view=smith>Visit the Gem Smith</a>] [<A href=seccity.php>Back to Town</a>]"; include("footer.php"); exit } if ($_GET['view'] == 'smith') { print "Yaaaarrrr"; include("footer.php"); exit; } ?> <?php include("footer.php"); ?> Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 5, 2008 Share Posted April 5, 2008 You are missing a semi-colon after the exit on line 27. <?php $title = "Gem Store"; include("header.php");?> <b>Store Owner:</b> Welcome to my store! Here you can <i>Buy</i> and <i>Sell</i> many diferent Priceless Stones..<br><br> <br> <?php if($stat[gembag] == n) { Print "<b>Store Assistant:</b> You dont appear to have a <i>Gem Bag</i>! How do you expect to collect all the precious stones that are available in this wonderful Town?<br><br>"; Print "<b>Store Assistant:</b> Here, take this.. Its on the house, but dont get telling people we do FreeBs!<br><br>"; Print "The store Assistant hands you a <b>Small Gem Bag<br><br><br></b>"; Print "[<A href=seccity.php>Back to Town?</a>]"; mysql_query("update players set gembag='s' where id=$stat[id]"); include("footer.php"); exit; } else { Print "<b>Store Assistant:</b> How are you getting on with that <i>Small Gem Bag</i>?<br> Normally you could upgrade that tiny thing! (For a Small Fee) But right now we are out of Stock.<br><br><br>"; Print "[<A href=gemstore.php?view=smith>Visit the Gem Smith</a>] [<A href=seccity.php>Back to Town</a>]"; include("footer.php"); exit; } if($_GET['view'] == 'smith') { print "Yaaaarrrr"; include("footer.php"); exit; } ?> <?php include("footer.php");?> Quote Link to comment Share on other sites More sharing options...
Monk3h Posted April 5, 2008 Author Share Posted April 5, 2008 Done.. No more error But i still have the same probem as before.. the Yaaaar Text isnt Apearing when you click/view the link. <?php $title = "Gem Store"; include("header.php"); ?> <b>Store Owner:</b> Welcome to my store! Here you can <i>Buy</i> and <i>Sell</i> many diferent Priceless Stones..<br><br><br> <?php if ($stat[gembag] == n ) { Print "<b>Store Assistant:</b> You dont appear to have a <i>Gem Bag</i>! How do you expect to collect all the precious stones that are available in this wonderful Town?<br><br>"; Print "<b>Store Assistant:</b> Here, take this.. Its on the house, but dont get telling people we do FreeBs!<br><br>"; Print "The store Assistant hands you a <b>Small Gem Bag<br><br><br></b>"; Print "[<A href=seccity.php>Back to Town?</a>]"; mysql_query("update players set gembag='s' where id=$stat[id]"); include("footer.php"); exit; } else { Print "<b>Store Assistant:</b> How are you getting on with that <i>Small Gem Bag</i>?<br> Normally you could upgrade that tiny thing! (For a Small Fee) But right now we are out of Stock.<br><br><br>"; Print "[<A href=gemstore.php?view=smith>Visit the Gem Smith</a>] [<A href=seccity.php>Back to Town</a>]"; include("footer.php"); exit; } if ($_GET['view'] == 'smith') { print "Yaaaarrrr"; include("footer.php"); exit; } ?> <?php include("footer.php"); ?> Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 5, 2008 Share Posted April 5, 2008 It's because your script exits no matter what before it even gets to that code. Do you see what I'm saying? Quote Link to comment Share on other sites More sharing options...
Monk3h Posted April 5, 2008 Author Share Posted April 5, 2008 Yea man, Cheers.. Its been a while since iv last programmed PHP. Bit drunk now.. Will change it later. PHP + Booz = Baaaaad. 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.