Jump to content

jushiro

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jushiro's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a sql statement w/c suppose to output only those records w/c has a name of seller. But, it keeps showing all the records. <?php session_start(); if(isset($_SESSION['name']) || ($_SESSION['contact']) || ($_SESSION['address']) ) { ini_set('display_errors', 0); $name = $_SESSION['name']; $contact = $_SESSION['contact']; $address = $_SESSION['address']; ?> <div id="apDiv1"> <?php echo "Name : $name"; echo "</br>"; echo "Name : $contact"; echo "</br>"; echo "Name : $address"; ?> <div id="apDiv2"> <?php $host="localhost"; $username="root"; $password=""; $db_name="feedbackdb"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM Feedbacks WHERE Seller = $name"; $result=mysql_query($sql); echo "<table border=\"5\" width=\"600\" >"; echo "<tr><th>Feedbacks</th><th>From</th><th> To </th>"; if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "" .$row['Feedback']."<br></td>"; echo "<td>".$row['From']."<br></td>"; echo "<td>".$row['Seller']."<br></td>"; echo "</tr>"; } } else { echo "<tr><td align=\"center\"> No Feedback</td></tr>"; } ?></div> </div> <?php } else { header("location:loginpage.php");; } ?>
  2. I dont know why my code is not inserting the values.. Someone help pls. <?php session_start(); if(isset($_SESSION['owner']) ) { $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("feedbackdb", $con); $from = $_POST['from']; $type = $_POST['type']; $feedback = $_POST['feedback']; $owner = $_SESSION['owner']; $from = stripslashes($from); $type = stripslashes($type); $feedback = stripslashes($feedback); $owner = stripslashes($owner); $from = mysql_real_escape_string($from); $type = mysql_real_escape_string($type); $feedback = mysql_real_escape_string($feedback); $owner = mysql_real_escape_string($owner); mysql_query("INSERT INTO Feedbacks (Feedback, From, To, Type,) VALUES ('$feedback', '$from', '$owner','$type')") or die(mysql_error); /*echo '<script type="text/javascript"> {alert("Feedback successfully Added");} </script>'; //echo '<meta http-equiv="REFRESH" content="0;url=Profilepage.php">';*/ } else { header("location:buysection.php");; } ?>
  3. I dont know how to say it but. To simplify this : I want to know how can i put values on the button? what i did is make a array to output those values and have buttons. here. if($result){ while($row = mysql_fetch_assoc($result)) { $itemname = $row['itemname']; $itemprice= $row['itemprice']; $owner =$row['owner']; $items[] = array($itemname,$itemprice,$owner); } } echo("<form action=\"buy.php\" method=\"post\">\n"); for ($i=0;$i<count($items);$i++) { echo("".$items[$i][0]."<br>\n"); echo("".$items[$i][1]."<br>\n"); echo("".$items[$i][2]."<br>\n"); echo "<input type=\"submit\" value=\"BUY\" name =\"buy\">"; echo "<input type=\"submit\" value=\"POST FEEDBACK\" name=\"name\"></br><br></form>"; } I succeeded in making those queries and button. but my problem is' The button "POST FEEDBACK" i want it to have the value of $items[$i][2].. So that when i turn to the next page i can echo the value of that POST FEEDBACK.
  4. What do you mean? But what i want is to query just those 3 values from my database and have button for that.
  5. Im having trouble making a code for a feedback system. Can anyone help me to make a code like this. I have a table w/c contains -------------------------------------------- | Itemname | Itemprice | Seller | Laptop | 15000 | Name Phone | 5000 | Name ----------------------------------- Then.. i want a code that will query those values.. And have a button : [bUY] and after the values. Then after clicking POST FEEDBACK it will show the values of the SELLER name in another page. HELP ME PLS
  6. Hi, Im making a form that contains 3 textboxes.. now i want my textboxes to contain only letters.. i used is_numeric for the validation but when i put' like.. "JUSHIRO1" my code will still accept it. can someone help me make a code that will validate my textbox to only accept letters. and one more.. when the user input in the textbox with a number a popup box will appear.
  7. Hmm.. i dont know how can i do a standalone that can be the same output to what i want to do but' here.. i just want to make a loop that outputs a dropdown list depending on how much quantity the user input.. Like if i put '2' as my quantity then it will output a 2 dropdown list that contains my values in my database.. can you help me make a code for that sir?
  8. I think this is the problem sir. but not quite sure where. for($i = 0; $i < $q; $i++){ echo "Bottle Number :"; echo "<select name=\"bottlenum[]\" onChange=\"this.name\"> <option>Select</option>"; if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { echo "<option>" .$row['BottleNumber']. "</option>"; } echo "</select>"; } else { echo "<option>No Customer Encoded</option></select>"; } This code will suppose to dropdown the BottleNumbers in my database' well since i create 1 bottlenumber w/c is "1111" the output of my dropdown would be "SELECT / 1111" well it works fine but when the code looped and created 2 pairs of the dropdown. the 2nd dropdown only output "SELECT".. Help me please sir.
  9. I've made a loop here.. <form name="formdeliver" method="post" action="addOrder.php" onSubmit="return confirm('Are you Sure the data inputed are correct? Click Ok to continue.')"> <div id="apDiv2" style="overflow:auto "> <?php $host="localhost"; $username="root"; $password=""; $db_name="SEdatabase"; $tbl_name="bottlenumbers"; 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); $name = $_SESSION['customername']; $q = $_SESSION['quantity']; echo "<table border='1'> <tr> <td><font size = '2'>Customer Name : $name </font></td></tr><tr> <td><font size = '2'>Quantity : $q </font></td> </tr> </table><br>"; for($i = 0; $i < $q; $i++){ echo "Bottle Number :"; echo "<select name=\"bottlenum[]\" onChange=\"this.name\"> <option>Select</option>"; if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { echo "<option>" .$row['BottleNumber']. "</option>"; } echo "</select>"; } else { echo "<option>No Customer Encoded</option></select>"; } echo "<font size = 2 >Type :</font> <select name=\"bottletype[]\" onChange=\"this.name\"'>'; <option selected>Select .. </option> <option> Slim </option> <option> Round </option> </select><br>"; } ?> <br> <input type="image" src="continue.png" width="100" height="25" name="login" border="0" /> </div> </form> So what it basically do is.. User will input some data w/c i included as $_POST['customername'] and $_POST['quantity'] So when the user will input 5 quantity.. i want my loop to have 5 pairs of 2 drop down list.. well i suceeded there. but, my problem is the 1st pair will output the .$row['BottleNumber']. w/c i included at the loop, and then the rest will have no output.. when i clicked them the dropdown list will only show the Select one. but for the 1st pair its working fine. Sorry for the bad english.. someone help me pls
  10. Can anyone help me to make a countdown timer in php? so basically i've made a quiz.. but i want it to have a time of 1 hour 30 mins.. but i dont have any idea of how to make a timer
  11. Are you using SQL?.. Try this. SELECT * FROM 1 , 2 , 3 Where A='x' AND B='y' AND C='z'
  12. I have a table in my php Mysql which contains some values.. Is it possible to get those values then export them to MS word with formatting? and make it like a table? Help pls. :'(
  13. I've Got here a code.. it can upload pdf file. but it doesnt accept word documents and powerpoints And i dont know the problem.. Here's The code.. <?php session_start(); if(isset($_SESSION['uname2'])){ if($_POST['lesson']!=""){ if (($_FILES["Mapfile"]["type"] == "application/acrobat") ||($_FILES["Mapfile"]["type"] == "application/x-pdf") || ($_FILES["Mapfile"]["type"] == "application/pdf") || ($_FILES["Mapfile"]["type"] == "text/pdf") || ($_FILES["Mapfile"]["type"] == "application/powerpoint") || ($_FILES["Mapfile"]["type"] == "application/msword") || ($_FILES["Mapfile"]["type"] == "text/x-pdf") && ($_FILES["Mapfile"]["size"] < 50000)) { if ($_FILES["Mapfile"]["error"] > 0) { echo "Error: " . $_FILES["Mapfile"]["error"] . "<br />"; } else { if (file_exists("upload/" . $_FILES["Mapfile"]["name"])) { echo '<script type="text/javascript"> {alert("'.$_FILES["Mapfile"]["name"] .' already exist");} </script>'; echo '<meta http-equiv="REFRESH" content="0;url=uploadlesson.php">'; } else { move_uploaded_file($_FILES["Mapfile"]["tmp_name"], "upload/" . $_FILES["Mapfile"]["name"]); echo '<script type="text/javascript"> {alert("File Uploaded!");} </script>'; echo '<meta http-equiv="REFRESH" content="0;url=uploadlesson.php">'; $host="localhost"; $username="root"; $password=""; $db_name="dbprof"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $user = $_SESSION['uname2']; $sql="SELECT * FROM registeredprof where Username = '$user'"; $result=mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { $fullname = $row['fullname']; } $title = $_POST['lesson']; $filename = $_FILES['Mapfile']['name']; mysql_query("INSERT INTO lessondb (author, title, filename, status) VALUES ('$fullname', '$title', '$filename', 'offline')"); } } } else { echo '<script type="text/javascript"> {alert("Invalid File! ");} </script>'; echo '<meta http-equiv="REFRESH" content="0;url=uploadlesson.php">'; } } else { echo '<script type="text/javascript"> {alert("Fill out Title!");} </script>'; echo '<meta http-equiv="REFRESH" content="0;url=uploadlesson.php">'; } } ?> Help pls.
  14. I've got here a code.. So basically this code is for deleting.. i want to set a Confimation popup box With yes or no.. then' When the user click yes, it will redirect to the next page. and if its a no. it would be at the same page. Here's my code. <form name="formnew" method="post" action="valdelsec.php"> <?php $host="localhost"; $username="root"; $password=""; $db_name="dbsection"; $tbl_name="sections"; 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); $count=mysql_num_rows($result); echo '<select style="position:absolute; top:307px; left:302px; width: 254px; height: 21px; font-size:10px;" name="section" onChange="this.name">'; echo "<option size =30 selected>Select</option>"; if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { echo "<option>" .$row['Sname']. "</option>"; } echo "</select>"; } else { echo "<option>No Section Present</option></select>"; } ?> <div id="apDiv11"><input type="image" src="images/delete.png" name="Image9" width="170" height="35" border="0" ></div> </form> .. Hoping for your help.. thx!
  15. Here's the screenshot for mozilla.. [attachment deleted by admin]
×
×
  • 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.