Menu

#6 A very simple Travel.php script

open-accepted
nobody
None
1
2003-10-29
2003-10-29
Kyle Muir
No

name a file travel.php and paste the following into it

<?php $title = "The Travel Center"; include
("header.php"); ?>
<?php
if ($stat[travelpass] <= N ) {
print "You don't have a Travel Pass! Would you like to
purchase a Travel pass? It's only 1000 platinum.";
print "<ul>";
print "<li><a href=travel.php?answer=yes>Sure</a>.";
print "<li><a href=city.php?answer=no>No</a>.";
print "</ul>";
if ($answer == yes) {
if ($stat[platinum] < 1000) { print "You do not have
enough platinum."; include("footer.php"); exit; }
else { print "You got a Travel Pass! Click <a
href=travel.php>here</a>."; mysql_query("update
players set platinum=platinum-1000 where id=$stat
[id]"); mysql_query("update players set travelpass='Y'
where id=$stat[id]"); }
}
include("footer.php");
exit;
}
?>
You walk into the Travel Center. Here, you can travel
around Indocron.<br><br>
Where would you like to go?<br><br>
<a href=city.php>Indocron</a><br>
<a href="alias.php">Alias</a>
<?php include("footer.php"); ?>

The only SQL tables u need to add is this

`travelpass` char(1) NOT NULL default 'N',

thats it. if you want to edit the price simply change
the "1000"s to whatever price you want. This worked for
me.

Discussion

  • Matt Evans

    Matt Evans - 2003-10-29
    • priority: 5 --> 1
    • status: open --> open-accepted
     
  • Nobody/Anonymous

    Logged In: NO

    whats the alias.php file? another city?

     
  • Kyle Muir

    Kyle Muir - 2003-10-30

    Logged In: YES
    user_id=893685

    Yes it is another city that i use.... you could have whatever
    you want...

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.