Jamie Taylor - Director of Posted June 16, 2007 Posted June 16, 2007 When I create a new city or course why when I press Add City does it simply clear the form fields and not create anything? Is there a fix? Thanks in advance. :-) Quote
GoldenZero Posted June 17, 2007 Posted June 17, 2007 Re: Creating new cities error I donno if the edit/delete work...but I did this a while ago so here is add city function addcity() { global $db, $ir, $c, $h, $userid; $minlevel=abs((int) $_POST['minlevel']); $name=$_POST['name']; $desc=$_POST['desc']; if($minlevel and $desc and $name) { $q=$db->query("SELECT * FROM cities WHERE cityname='{$name}'"); if($db->num_rows($q)) { print "Sorry, you cannot have two cities with the same name."; $h->endpage(); exit; } $db->query("INSERT INTO cities VALUES(NULL, '$name', '$desc', '$minlevel')"); print "City {$name} added to the game."; stafflog_add("Created City $name"); } else { print "<h3>Add City</h3><hr /> <form action='staff_cities.php?action=addcity' method='post'> Name: <input type='text' name='name' /> Description: <input type='text' name='desc' /> Minimum Level: <input type='text' name='minlevel' /> <input type='submit' value='Add City' /></form>"; } } Quote
grimreaper6996 Posted June 17, 2007 Posted June 17, 2007 Re: Creating new cities error what version of mccodes do u have..If u have v 2....Try this http://criminalexistence.com/ceforums/i ... pic=1895.0 Quote
Will Posted June 17, 2007 Posted June 17, 2007 Re: Creating new cities error It would be easier just to enter it into the database. Quote
GoldenZero Posted June 17, 2007 Posted June 17, 2007 Re: Creating new cities error its just the extra ' befor minlevel Quote
Jamie Taylor - Director of Posted June 17, 2007 Author Posted June 17, 2007 Re: Creating new cities error Yup, I found that :) MCCODES 2 is very very poorly coded for $300. Fixed, anyway. Quote
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.