Jump to content

winningdave

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by winningdave

  1. This should get your basic parameters into a file for you. <?php $req_dump = print_r($_REQUEST, TRUE); $fp = fopen('request.log', 'a'); fwrite($fp, $req_dump); fclose($fp); ?> You should then be able to write the parameters to a csv file: <?php $string = $_REQUEST['PBX_ID'].",".$_REQUEST['DIALED_NUMBER'].",".$_REQUEST['CALLER_ID_NUMBER'].",".date("Y-m-d H:i:s")."\r\n"; file_put_contents('jive.csv',$string,FILE_APPEND|LOCK_EX); ?> You may need to encapsulate the data in double quotes if you hit a snag with special characters
  2. Maybe try SELECT id, brand_id, dev_model, dev_version, FROM devices WHERE (dev_model LIKE '%".$database->escape_values($parts[$i]) ."%' OR dev_version LIKE '%".$database->escape_values($parts[$i]) ."%') ORDER BY SCORE DESC LIMIT 4
  3. You're never going to get an exact location as you are relying on the ISP of the user. Your best bet would be to use HTML geolocating and then look up a location from there
  4. You will also need to look at what you're calling your checkboxes. Each name should be unique. You may have to also assign each one a value depending on how your using it
  5. You've got a form within form which you can't so. If you need two separate forms on a page you will need to close them properly then using JavaScript is the easiest way to submit different forms. <form action ="trip1.php" method="post" name="form1"> <p><input type="checkbox" name="agree" /> Auckland</p> </form> <form action ="trip.php" method="post" name="form2"> <p><input type="checkbox" name="agree" /> North Shore</p> <p><input type="checkbox" name="agree" /> Waikato</p> <p><input type="checkbox" name="agree" /> Taranaki</p> <p><input type="checkbox" name="agree" /> Toupo</p> <p><input type="checkbox" name="agree" /> Wellington/p> <p><input type="checkbox" name="agree" /> Bay of Plenty</p> <p><input type="checkbox" name="agree" /> Manukau</p> <p><input type="submit" value="submit" onclick="form2.submit();"/></p> </div> </form>
  6. http://forums.phpfreaks.com/topic/107727-solved-display-pdf-file-inline-how/
  7. Hi. Carlitoway, At the moment you are just checking to see if the query has been executed and nothing to do with the result... I'd recommend the following <?php $id = $_POST["id"]; $contrasena = $_POST["contrasena"]; $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $sql = "DELETE FROM provicional WHERE (id, contrasena) = ($id, '$contrasena')"; mysql_select_db('propiedades'); $retval = mysql_query( $sql, $conn ); //RETRIEVE THE NUMBER OF ROWS CHANGED IN THE PREVIOUS QUERY $affected = mysql_affected_rows($conn); if($affected!=1) { die('Could not delete data: ' . mysql_error()); } echo "Deleted data successfully\n"; mysql_close($conn); ?> You probably want to look at your query as well. Should be more along the lines of; $sql = "DELETE FROM provicional WHERE id='$id' AND contrasena = '$contrasena'";
  8. $image0 = $_SESSION['ls_user']; $image = "img/".$image0.".png"; $image1 = "<img src=img/$image0.png>"; $image2 = "<img src=img/default.png>"; if (file_exists( $image )) { echo $image1; } else { echo $image2; }
  9. My 2 cents: Database should look something like this : id | subject | body | sender | recipient | read When a new message is created "read" would be set to 0, when the user reads it that would be updated to 1. As far as how you go about it, its up to you. You said avoid Javascript in that case you could provide an "Inbox" list of message and when a user opens the full message , set the read field to 1...
  10. Ahh ok so you are trying to update multiple items at once. If your loop is working then all you should have to do $pricetwo = $price[$i] * 0.9; and $pricethree = $price[$i] * 0.8;
  11. The above code will get the priceone, take 10% off to give you price two and then take 20% off price one to give you price three and will update the database. You dont need the loop as you are only updating two rows and already have separate queries. You would only need the loop if you wanted to update say 10 items as once and pricetwo and pricethree of each of these. EDIT:$sql2 should be - $sql2= mysqli_query($myConnection, "UPDATE pricesthree SET productname='".$name."', productweight='".$weight."', productprice='".$pricethree."' WHERE priceid='".$priceid."'");
  12. Give that a try. Move the </a> just before the close </div> if you want the text to be hyperlinked too <?php // Run a select query to get my letest 6 items // Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $dynamicList = ""; $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 500"); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $product_name = $row["product_name"]; $price = $row["price"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); $dynamicList .=''; echo '<div style='float:left;'><a href="product.php?id=' . $id . '"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="77" height="102" border="1" /></a><br />' . $product_name . ''</div>"; } } else { $dynamicList = "We have no products listed in our store yet"; } mysql_close(); ?>
  13. Is your server maybe not allowing outgoing mail? Maybe try PHPMailer and use authenticated SMTP. I've had troubles on shared servers before and weird IIS configs and that usually solves it
  14. Are you trying to edit one item at at time? If so you dont need the for loop and Im not sure if you already have the data in the tables to do the update. If not you need to do an insert. Dont forget to escape you POST variables. Not sure if this is how you have your form setup but here's my two cents <?php $priceid = $_POST['priceid'] ; $name = $_POST['productname'] ; $weight = $_POST['productweight']; $price = $_POST['productprice']; if(isset($_POST['updateprices'])) { //Get priceone $priceone = mysqi_query("SELECT productprice FROM prices WHERE priceid='".mysql_real_escape_string($priceid)."'"); //If we get a row back then update the other two tables if(mysql_num_rows($priceone)>0){ //Price one $priceone = mysql_result($priceone,0,'productprice'); $pricetwo = $priceone * 0.9; $pricethree = $priceone * 0.8; //Im not sure if your really trying to update the tables here or if you need to insert - does the data already exist? $sql1= mysqli_query($myConnection, "UPDATE pricestwo SET productname='".$name."', productweight='".$weight."', productprice='".$pricetwo."' WHERE priceid='".$priceid."'"); $sql2= mysqli_query($myConnection, "UPDATE pricesthree SET productname='".$name."', productweight='".$weight."', productprice='".$pricetwo."' WHERE priceid='".$priceid."'"); //Redirects page using PHP header("Location: edit_product_prices.php"); } } ?>
  15. Do you have the CURL extension enabled on your production server? use phpinfo() to find out
×
×
  • 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.