Jump to content

Rage

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Rage

  1. One way todo this (if i am understanding correctly): if($_GET['action']=="upload") { // Process Image } then have the upload form <form method="post" action="yourpage.php?action=upload" >
  2. i would personally put it in a switch so you can have different banners for different days not the cleanest code but it gets the job done
  3. Just apply a login cookie to hold some data so they stay logged in
  4. <?php global $array; global $match; $array = array(); $match = "0"; function add_value($a) { global $array; global $match; if(count($array)>0){ $match = "1"; } else { array_push($array, $a); } } add_value("1"); print_r($array);
  5. You should probably be using javascript to check these but when the forum is submitted, before it mails them it checks if the variable has any value if it does it continues on and checks the next one
  6. $match = 0; if(count($numsarray) > 0 ){ foreach ($numsarray as $chorenum) { if($chorenum == $a) { $match = 1; } } } else { array_push($numsarray, $a); }
  7. post your entire php script so i can see more
  8. Rage

    hello newbie

    <div id=""></div>
  9. You need to set your mail() to use html using headers
  10. You are using $this-> outside of a class, $this can only be used to access things in its own class
  11. Rage

    My intro?

    I like to program, working on learning obj-c, javascript and c++ currently. Thanks
  12. HTML FORM <table> <tr> <td>Size</td> <td><select name="size"> <option value="small">Small</option> <option value="medium">Medium</option> <option value="large">Large</option> <option value="Extra Large">Extra Large</option> <option value="Extra Extra Large">Extra Extra Large</option> <option value="Extra Extra Extra Large">Extra Extra Extra Large</option> </select> </td> </tr> <tr> <td>Quantity:</td> <td><select name="quantity"> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> <option value="4">Four</option> </select> </td> </tr> <tr> <td>Shirt Color:</td> <td><select name="cat"> <option value="white">White</option> <option value="grey">Grey</option> <option value="blue">Blue</option> <option value="red">Red</option> </select> </td> </tr> <tr> <td> <a href="#" onClick="MakeRequest('.$id.')"><b>Add To Cart</b></a> </td> </tr> </table> $id is a value passed in using php. On submit it runs the function MakeRequests and passes in the $id var. <script type="text/javascript"> function getXMLHttp() { var xmlHttp try { //Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch(e) { //Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("Your browser does not support AJAX!") return false; } } } return xmlHttp; } function MakeRequest(id) { var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { HandleResponse(xmlHttp.responseText); } } xmlHttp.open("GET", "update_field.php?id="+id, true); xmlHttp.send(null); } function ClearIt() { var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { HandleResponse(xmlHttp.responseText); } } xmlHttp.open("GET", "update_field.php?clear=asd", true); xmlHttp.send(null); } function HandleResponse(response) { document.getElementById('cart').innerHTML = response; } </script> I need it to pass in the values chosen in the form and add them to the end of the URL: xmlHttp.open("GET", "update_field.php?id="+id, true); I am learning ajax as i go however i cannot figure out how todo this. Thank you for your help!
×
×
  • 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.