Jump to content

ixnayz

New Members
  • Posts

    6
  • Joined

  • Last visited

ixnayz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I'm coding a page that starts with a select list loaded from a database and I want to make a different query depending on the item selected, I have been searching around and I can't find a php version of the selectedIndex of a listbox in javascript, any idea? thanks.
  2. I understand the part of each being executed from different sides, so how would you do it?
  3. These values exist in the js file, and I thought that the line would create them in the php file as well. If I define them first in the php file would it work?
  4. Wow, many responses, let me answer one by one. requinix: the vName, vEmail and the rest are from the form I'm sending, I removed the part dealing with them by mistake and since they seemed to work fine while controlling the no empty field thing, I just forgot about them. { zProduct: zProduct, zBay: zBay, zMeasures: zMeasures, zDoor: zDoor, zPlinth: zPlinth, zMount: zMount, zBattery: zBattery} There's a zProduct and the rest at the js file, my friend told me that doing this would also create the variables in the php file as well. Right now the js file doesn't have that line since it seems to be doing nothing at all, plus I'm having the same error while only using the php file as it is. CroNiX: $.post( "send.php", { zProduct: zProduct, zBay: zBay, zMeasures: zMeasures, zDoor: zDoor, zPlinth: zPlinth, zMount: zMount, zBattery: zBattery} ); This values are the ones I use to store the options selected, and this friend told me that this line in the js file would pass the variables and their contents to the php file. I have been using jQuery for a really short time and the code is still half-jq half old-js until I am more confident with it, sorry for the confusing read. The same happens with php, I'm still learning and things get confusing when mixing different languages. So, any solution to my problem? How would you pass the values from the js file to the php file so I can send them? Thanks.
  5. The Js file is too big so I'm posting the part dealing with php, this is what a friend told me to try: function div_show(){ document.getElementById('abc').style.display = "block"; document.getElementById('formtable').hidden=true; document.getElementById('DivDesc').hidden=true; document.getElementById('DivSend').hidden=true; document.getElementById('DivSum').hidden=true; <?php $.post( "send.php", { zProduct: zProduct, zBay: zBay, zMeasures: zMeasures, zDoor: zDoor, zPlinth: zPlinth, zMount: zMount, zBattery: zBattery} ); ?> } this gives me the undefined index error, and this is the php file: <?php if(isset($_POST["vSubmit"])){ if($_POST["vName"]==""||$_POST["vEmail"]==""||$_POST["vSub"]==""||$_POST["vMsg"]==""){ echo "Fill All Fields.."; } else{ $email=$_POST["vEmail"]; $email =filter_var($email, FILTER_SANITIZE_EMAIL); $email= filter_var($email, FILTER_VALIDATE_EMAIL); if (!$email){ echo "Invalid Sender's Email"; } else{ $subject = $_POST["vSub"]; $message = $_POST["vMsg"] . "<br>" . "<br>" . "Specs" . "<br>" . "<br>" . "Hola" . "<br>"; $message .= "Product - " . $_POST["zProduct"] . "<br>"; /* $message .= 'Bay -' . $_POST['zBay'] . "<br>"; $message .= 'Measures -' . $_POST['zMeasures'] . "<br>"; $message .= 'Door -' . $_POST['zDoor'] . "<br>"; $message .= 'Plinth -' . $_POST['zPlinth'] . "<br>"; $message .= 'Mount -' . $_POST['zMount'] . "<br>"; $message .= 'Battery -' . $_POST['zBattery'] . "<br>"; /* $headers = 'From:'. $vEmail . "<br>"; $headers .= 'Cc:'. $vEmail . "<br>"; $message = wordwrap($message, 70); mail("xxxx@gmail.com", $subject, $message, $headers); echo $message; } } } ?>
  6. Hello, I,m doing an internship and they've asked me to do a 'sales page' where you pick a product and its features through diferent listboxes in a HTML page, the idea would be after clicking 'Send' to send an email to the sales department with the product and the options chosen to study the order. So far I have everything donde except the send email function where I'm getting the same error 'undefined index' and I can't see the values stored. iDesk.innerHTML= '<b>Product</b> - ' + zProduct + '<br><b>Bay</b> - ' + zBay + '<b... This is js file, I intend to pass the values of zProduct, zBay in the php file so I can send them as a list by email. $message .= "Product - " . $_POST["zProduct"] . "<br>"; This gives me the same error 'undefined index zProduct', I've asked around and someone told me to try to store the values from the javascript file with $.post( "send.php", { zProduct: zProduct, zBay: zBay...}) but I'm still getting the same error, can someone help me out? 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.