Jump to content

AsiaUnderworld

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

AsiaUnderworld's Achievements

Member

Member (2/5)

0

Reputation

  1. should be a simple fix this, but my mind has just gone, late night Parse error: syntax error, unexpected T_VARIABLE, expecting '(' on line 36 heres the code : <?php if(isset($_POST['submit'])) { // make all the post vars safe $email = QuerySecure($_POST['email']); /// Check if all fields are filled out and not empty if (strlen($email) < 1 ) echo '<div class="redalert>You have left a field blank, all fields must be completed, please go back and correct this.</div><br />'; elseif $sql = mysql_query("SELECT email FROM pre_register WHERE email = $email LIMIT 1"); if(mysql_num_rows($sql) != 0) echo '<div class="redalert">You have already pre-registered</div><br>'; else { mysql_query("INSERT INTO pre_register SET email = $email"); } } } ?>
  2. hi all, ive written a script for my game, its a bullet factory however i need the script to update a row in the table every hour, adding 500 bullets every hour, but im not sure where to start, any help would be great
  3. [just realised ive been an idiot, and attempting a fix now]
  4. surely theres some bit missing from the code you've just suggesteD? i have a textbox input called email
  5. Hi there, im using the php mail function to send an email after a form is run, however when i get the email, it just says Dear 'Array', and hello Array , rather than the printed username, it also says Undefined index: email in /home/vheissu/public_html/feedback.php on line 20 Undefined index: email in /home/vheissu/public_html/feedback.php on line 47 both of these lines are : $email = $_POST['email']; otherwise here is the code <? $id = (int) $_SESSION['user_id']; $email = $_POST['email']; if(isset($_POST['submit'])) { $topic = mysql_real_escape_string($_POST['topic']); $ticket = mysql_real_escape_string($_POST['ticket']); if (strlen($topic) < 1) echo "<div align=center>Please enter a topic</div>"; elseif(strlen($ticket) < 1) echo "<div align=center>Please Enter ticket information</div>"; else { $sql = mysql_query("INSERT INTO helpdesk (topic,message,user) VALUES ('$topic','$ticket','".mysql_real_escape_string($id)."')"); if($sql) echo "<div align=center>Ticket submitted</div>"; else echo "<div align=center>There is a problem sending the ticket</div>"; } } $id = (int) $_SESSION['user_id']; $sql2 = mysql_query("SELECT username FROM user_details WHERE id = '".mysql_real_escape_string($id)."'"); $username = mysql_fetch_assoc($sql2); $email = $_POST['email']; $subject = "American Gangsters"; $message = "Dear '".$username."', Hello $username , thank you for signing up with American Gangsters Your Feedback is important to us. This is an automated response, please do not reply!"; mail($email, $subject, $message, "From: American Gangsters<payments@americangangsters.org>"); ?>
  6. Hi, im trying to get php to sum the total of figures in a row in my database the row is called msgtotal and table called user_stats , in the row msg total, theres one value 3, one of 1, then the rest are currently 0 , so the total should be 4, however it always says its 1 heres my code.. $sql2 = ("SELECT forumposts,msgtotal FROM user_stats"); $sql2 = mysql_query($sql2) or die(mysql_error()); $total_messages = mysql_fetch_assoc($sql2); and then echo the following <?=number_format(count($total_messages['msgtotal']))?>
  7. Hi, ive got some simple code, kind of a guestbook like thing where people can type their name and message and post it, however if you hit refresh, it sends it again, so you can spam, any way of me stopping this? <?php if(isset($_POST['submit'])) { $name = mysql_real_escape_string($_POST['name']); $msg = mysql_real_escape_string($_POST['msg']); if (strlen($name) < 1) echo "<div align=center>Please enter your name</div>"; elseif(strlen($msg) < 1) echo "<div align=center>Please Enter a message</div>"; else { $sql = mysql_query("INSERT INTO guest (postername,content) VALUES ('$name','$msg')"); if($sql) echo "<div align=center>Message posted</div>"; else echo "<div align=center>There was a problem.</div>"; } } ?>
  8. Hi there, ive made a very simple site design consisting of a one table split up into some rows and columns when one column gets more in it, it moves the links in the column on the left to go down, is there any way of anchoring them to the top? to see what i mean go on my home page http://www.freneticlolpunch.com/index.php then click the comics page and you will see links have moved down. If pages dont load, refresh a few times, im hving a few dns errors. ~thanks ------ Just realised im an idiot and forgot to Valign
  9. can i not have another CSS stylesheet on that page then? Ive done it back to lightbox css but its still not doing anything.
  10. Hi, im trying to get lightbox to work on my site http://www.freneticlolpunch.com/comics.php this is the page and the testimage link should open up the light box, ive saved all the files to my server and heres the code i put, any thoughts on why its not working? <head> <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="js/lightbox.js"></script> <link rel="stylesheet" href="in.css" type="text/css" media="screen" /> <a href="banner.jpg" rel="lightbox">TestImage</a> </head> I've already declared <link rel="stylesheet" type="text/css" href="in.css"> earlier in the script but i dont think this is a problem Also please note i copied and pasted lightbox.css into my file in.css Thanks
  11. I've moved my code to a new server, and ive now got these errors Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/niccaman/public_html/checkuser.php on line 42 Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/niccaman/public_html/checkuser.php on line 42 Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/niccaman/public_html/checkuser.php on line 57 Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/niccaman/public_html/checkuser.php on line 57 Warning cannot modify header information - headers already sent by (output started at /home/niccaman/public_html/checkuser.php:42) in home/niccaman/public_html/checkuser.php on line 24 Whats up with this? Here are the lines around 42: 37 global $con; 38 $q = "SELECT ID FROM userinfo WHERE username = '$user'"; 39 $result = mysql_query($q, $con); 40 $result = mysql_fetch_array($result) o die ('error: ' .mysql_error()); 41 $i = 0; 42 while ($i <= mysql_num_rows($result)) 43 { 44 $r = $r . $result[$i]; 45 $i++; 46 } 47 48 return $r; 49 } help would be great
  12. I've moved my code to a new server, and ive now got these errors Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/niccaman/public_html/checkuser.php on line 42 Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/niccaman/public_html/checkuser.php on line 42 Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/niccaman/public_html/checkuser.php on line 57 Warning mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/niccaman/public_html/checkuser.php on line 57 Warning cannot modify header information - headers already sent by (output started at /home/niccaman/public_html/checkuser.php:42) in home/niccaman/public_html/checkuser.php on line 24 Whats up with this? Here are the lines around 42: 37 global $con; 38 $q = "SELECT ID FROM userinfo WHERE username = '$user'"; 39 $result = mysql_query($q, $con); 40 $result = mysql_fetch_array($result) o die ('error: ' .mysql_error()); 41 $i = 0; 42 while ($i <= mysql_num_rows($result)) 43 { 44 $r = $r . $result[$i]; 45 $i++; 46 } 47 48 return $r; 49 } help would be great
  13. <? $id = secure($_SESSION['user_id']); $id = $id[0]; $sql = "SELECT * FROM user_stats WHERE user_id='$id'"; $result = mysql_query($sql); $result2 = mysql_fetch_assoc($result); $firstcheck = "SELECT ticketprice FROM airport WHERE id='1' "; $firstcheck1 = "SELECT ticketprice FROM airport WHERE id='2' "; $firstcheck2 = "SELECT ticketprice FROM airport WHERE id='3' "; $firstcheck3 = "SELECT ticketprice FROM airport WHERE id='4' "; $price = mysql_query($firstcheck) or die(mysql_error()); $price1 = mysql_query($firstcheck1) or die(mysql_error()); $price2 = mysql_query($firstcheck2) or die(mysql_error()); $price3 = mysql_query($firstcheck3) or die(mysql_error()); if(isset($_POST['travel'])) if (isset($_POST['radio'])) { $radio=strip_tags($_POST['radio']); if (!ereg('[^0-9]',$radio)) { if ($radio == "1") { $costs = $price ; $to = "Chicago"; } elseif ($radio == "2") { $costs = $price1; $to = "Detroit"; } elseif ($radio == "3") { $costs = $price2 ; $to = "New York"; } elseif ($radio == "4") { $costs = $price3 ; $to = "Washington"; } } if ($fetch->lasttravel > time()) echo "You cannot travel for another ".maketime($result2->lasttravel)." "; elseif ($costs > $result2->money) echo " You don't have enough money for this ticket" ; } elseif ($costs <= $result2->money) { } elseif ($to == $result2->location_id) echo " You are already in this city. " ; { } if ($to != $result2->location_id) { $flightcosts = $result2->money - $costs; $now = time() + 3600; mysql_query("UPDATE user_stats SET location_id='$to', money='$flightcosts' , lasttravel='$now' WHERE user_id='$id'"); } ?> The page says 15:17 pm: Notice: Trying to get property of non-object in /home/djwdesi/public_html/gangster/airport.php on line 80 15:17 pm: Notice: Undefined variable: to in /home/djwdesi/public_html/gangster/airport.php on line 80 Those lines are } if ($to != $result2->location_id) { When i click the submitbutton to travel it still does nothing, whats wrong? thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.