Jump to content

ZulfadlyAshBurn

Members
  • Posts

    783
  • Joined

  • Last visited

Everything posted by ZulfadlyAshBurn

  1. Sorry, there was syntax error on the previous code, here is the updated one. <?php session_start(); $appr = 0; $reje = 0; if(isset($_SESSION['uname2']) || isset($_SESSION['section'])) { $con = mysql_connect("localhost","root",""); if(isset($_POST['approve_x']) && isset($_POST['approve_y'])) { mysql_select_db("dbreg", $con); foreach ($_POST['list'] as $checkbox) { $sql="SELECT * FROM account WHERE Username='$checkbox'"; $result=mysql_query($sql); while($row = mysql_fetch_assoc($result)) { $username = $row['Username']; $password = $row['Password']; $gname = $row['gname']; $mname = $row['mname']; $famname = $row['famname']; $sec = $row['sec']; $studnum = $row['studnum']; $fullname = $row['fullname']; $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $gname = stripslashes($gname); $famname = stripslashes($famname); $gname = mysql_real_escape_string($gname); $famname = mysql_real_escape_string($famname); $mname = stripslashes($mname); $mname = mysql_real_escape_string($mname); mysql_query("INSERT INTO dbaccount (Username, Password,gname,famname,mname,sec,studnum,fullname) VALUES ('$checkbox', '$password', '$gname', '$famname', '$mname', '$sec', '$studnum', '$fullname')") or die(mysql_error); mysql_query("DELETE FROM account WHERE Username='$checkbox'") or die(mysql_error); $appr++; } } } elseif(isset($_POST['reject_x']) && isset($_POST['reject'])) { mysql_select_db("dbreg", $con); foreach ($_POST['list'] as $checkbox) { $sql="SELECT * FROM account WHERE Username='$checkbox'"; $result=mysql_query($sql); if(mysql_num_rows($result)) { mysql_query("DELETE FROM account WHERE Username='$checkbox'") or die(mysql_error); $reje++; } else { echo '<meta http-equiv="REFRESH" content="0;url=approvereject2.php">'; } } } if($appr > 1) { echo '<script type="text/javascript">alert("Approved!");</script>'; echo '<meta http-equiv="REFRESH" content="0;url=approvereject2.php">'; } if($reje > 1) { echo '<script type="text/javascript">alert("Rejected!");</script>'; echo '<meta http-equiv="REFRESH" content="0;url=approvereject2.php">'; } } else { header("location:failunautho.php"); } ?>
  2. then get the international pricing and do the same thing?
  3. try this <?php session_start(); $appr = 0; $reje = 0; if(isset($_SESSION['uname2']) || ($_SESSION['section'])){ $con = mysql_connect("localhost","root",""); if(isset($_POST['approve_x'], $_POST['approve_y'])) { mysql_select_db("dbreg", $con); foreach ($_POST['list'] as $checkbox) { $sql="SELECT * FROM account WHERE Username='$checkbox'"; $result=mysql_query($sql); while($row = mysql_fetch_assoc($result)) { $username = $row['Username']; $password = $row['Password']; $gname = $row['gname']; $mname = $row['mname']; $famname = $row['famname']; $sec = $row['sec']; $studnum = $row['studnum']; $fullname = $row['fullname']; $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $gname = stripslashes($gname); $famname = stripslashes($famname); $gname = mysql_real_escape_string($gname); $famname = mysql_real_escape_string($famname); $mname = stripslashes($mname); $mname = mysql_real_escape_string($mname); mysql_query("INSERT INTO dbaccount (Username, Password,gname,famname,mname,sec,studnum,fullname) VALUES ('$checkbox', '$password', '$gname', '$famname', '$mname', '$sec', '$studnum', '$fullname')") or die(mysql_error); mysql_query("DELETE FROM account WHERE Username='$checkbox'") or die(mysql_error); $appr++; } } } elseif(isset($_POST['reject_x'], $_POST['reject'])) { mysql_select_db("dbreg", $con); foreach ($_POST['list'] as $checkbox) { $sql="SELECT * FROM account WHERE Username='$checkbox'"; $result=mysql_query($sql); if(mysql_num_rows($result)) { mysql_query("DELETE FROM account WHERE Username='$checkbox'") or die(mysql_error); $reje++; } else { echo '<meta http-equiv="REFRESH" content="0;url=approvereject2.php">'; } } } if($appr > 1) { echo '<script type="text/javascript">alert("Approved!");</script>'; echo '<meta http-equiv="REFRESH" content="0;url=approvereject2.php">'; } if($reje > 1) { echo '<script type="text/javascript">alert("Rejected!");</script>'; echo '<meta http-equiv="REFRESH" content="0;url=approvereject2.php">'; } else { header("location:failunautho.php"); } ?>
  4. What I would do is to make sure every parking lot have a name for it (e.g. lot1, lot2, lot3 ...) Then create a form below the image and have a dropdown list for all the parking lots. the rest should be simple by using php.
  5. i see that you also posted on sitepoint but received no response. this is the official calculator for ups. I don't think that there is any way you can determine the shipping price because only those who work in UPS would know.
  6. the code you put there cannot help you. we need more code... anyway, why is the alert function in brackets?
  7. Page 1 <?php session_start(); $_SESSION['name']="test"; ?> <a href="page2.php"> click here </a> Page2 <?php session_start(); if (!isset($_SESSION['name'])) { Header("Location: page1.php"); } ?>
  8. Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/cdorris/www/tools.exiled-alliance.com/dev/index.php on line 29 October 13, 2011 want to look at the error.
  9. thanks thrope, will check it out.
  10. Tried the site, didn't work really well though. What I'm offering the users is about the same but more stuffs that comes with it. Ouh, I need help in the syntax highlighting. Where can i find those?
  11. I have an idea to create a website which allows user to post their code online such as pastebin. Once they have pasted the code, they have the options to allow public/private people to view the source code or run the page. They also have the option to key in a password if they wish to edit the source code later on. Its sort of one page hosting.
  12. what are the syntax errors?
  13. So is it solved? if it is, mark topic as solved
  14. create different signup pages? that would be the most logical way i guess.
  15. try this <form name="formapprove" method="POST" action="valval3.php" > <div id="apDiv12"><input type="image" src="images/Approve.png" name="approve" value="approve" width="170" height="35" border="0" > </div> <div id="apDiv11"> <input type="image" src="images/reject.png" name="reject" width="170" height="35" border="0" value="reject"> </div> <div id="apDiv14"> <?php $host="localhost"; $username="root"; $password=""; $db_name="dbreg"; $tbl_name="account"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); echo "<table border=\"5\" width=\"400\" >"; echo "<tr><th>List of Student to be approve</th>"; if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "<input type='checkbox' name='list[]' value='".$row['Username']."'>".$row['famname'].",".$row['gname']. ",".$row['mname']. ".<br/></td>"; echo "</tr></input>"; } } else { echo "<tr><td align=\"center\"> No Student to be Approve / Reject </td></tr>"; } echo "</form>"; ?>
  16. no prob edit: actually AyKay47 pointed it out but you didn't get it.
  17. he havent do the links yet.
  18. i know that, but, what he wanted is something that can edit the site for him.
  19. <img src="http://swatsamp.net/swat.php?nick=<?php echo $_POST['fname']?>" alt="swat" width="200" height="80"> try this.
  20. <?php session_start(); $_SESSION['startdate'] = $_POST['startdate']; $_SESSION['enddate'] = $_POST['enddate']; ?>
  21. yes. use $_SESSION[];
  22. this line echo "<td>" . $row['origip'] . "</td>"; you are missing a quote. should be echo "<td>" . $row[origip'] . "</td>";
  23. post the form code. i think there is something wrong with your form code.
  24. what do you mean the link to now.php is dynamic? whats the point of having seperate <?php ?> tags? <?php require_once('auth.php'); require_once ('connect.php'); // Connect to the database. if (!empty($_GET['startdate'])) { $date = $_GET['startdate']; } else { $date = "FALSE"; echo '<p><font color="red">Please enter the Course ID!</font></p>'; } if (!empty($_GET['enddate'])) { $date2 = $_GET['enddate']; } else { $date2 = "FALSE"; echo '<p><font color="red">Please enter the Course ID!</font></p>'; } echo $date; echo $date2; try that code instead.
  25. post your now.php code. have you done what i've asked you to do? did you get any alert box with data?
×
×
  • 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.