Jump to content

asevie

Members
  • Posts

    10
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

asevie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm trying to take two php variables for lat/long ($lat and $long) and display a small iframe with the corresponding google map. I have this after a successful insert of the user submitted lat/long... echo "<iframe src=\"http://maps.google.com/?q=$lat,$long\" scrolling=\"yes\" frameborder=\"0\" width=\"300\" height=\"400\"></iframe>"; Any idea why this doesn't display after a user successfully submits a location?
  2. Fairly new to html, php etc. I can create rudimentary forms but now I'm trying to add multiple records at a time. How do I make the following a variable? I'd like to have this as my insert... $sql = "INSERT INTO `somedb` ( `ffid` , `email` , `sku`) VALUES ( $somenewvariable )"; Where $somenewvariable equals this; ' ', 'email1@gmail.com', '408'), (' ', 'email2@example.com', '400'), (' ', 'email3@example.com', '412' I'm missing something very basic, ie back slashes! The variable is turning into something like this; \'\', \'email1@gmail.com\', \'408\'), (\'\', \'email2@gmail.com\', \'400\'
  3. I'm converting a search feature that currently uses two successive dropdown fields to do the search. The search is initiated when the user selects the option from the dropdown. The resultant (it's always 1 record) is then displayed in detail with a + sign next to it so that the user can add the record he just searched for. I've replaced it with a single dropdown and type-ahead field that uses javascript. The type ahead replaces the second drop down. I didn't want users have to select amongst hundreds of records in a drop down, by forcing them to start typing the second drop down, I can narrow the results to the exact item the user is looking for. My problem is that I'm not sure how to get the type ahead result to initiate the search on the user select. I initiate it like this in the old version... <table> <tr> <td width="130px" valign="top"><form name="nav"><select name="platform" id="platform" onChange="document.location.href=document.nav.platform.options[document.nav.platform.selectedIndex].value"> <option>Platform</option> <? $result = mysql_query("SELECT * FROM Platform"); while($row = mysql_fetch_array($result)) { ?> <option value="?ptfm_ctrl=1&ptfm_id=<?=$row['id_platform']?>" <? if ($_GET['ptfm_id']==$row['id_platform']) { ?>selected="selected"<? } ?>><?=$row['platform']?></option> <? } ?> </select></form></td> <? if (isset($_GET["ptfm_ctrl"])) { ?> <tr> </table> The new solution generates the type ahead result like this... <div> <form> <div> Start typing the name of the product, select the correct title when it appears: <br /> <input type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList"> </div> </div> </form> </div> This populates the field but I'd like to submit it on the populate. How can I initiate the search using the second method?
  4. This is what I use... It comes after the INSERT (assuming you're using mysql)... .... $message = "Thank you for registeringr blah blah. Here are the login details...\n\n User Name: $_POST[user] \n Password: $_POST[pass2] \n Thank you. This is an automated response. PLEASE DO NOT REPLY. "; mail($_POST['email'] , "Activation", $message,"From: \"Auto-Response\" <notifications@$host>\r\nX-Mailer: PHP/" . phpversion()); echo "<div class=\"error\"><h2>Registration Successful! <small>An activation has been sent to your email address with account details...</small></h2></div>";
  5. I'm converting a search feature that currently uses two successive dropdown fields to do the search. The search is initiated when the user selects the option from the dropdown. The resultant (it's always 1 record) is then displayed in detail with a + sign next to it so that the user can add the record he just searched for. I've replaced it with a single dropdown and type-ahead field that uses javascript. The type ahead replaces the second drop down. I didn't want users have to select amongst hundreds of records in a drop down, by forcing them to start typing the second drop down, I can narrow the results to the exact item the user is looking for. My problem is that I'm not sure how to get the type ahead result to initiate the search on the user select. I initiate it like this in the old version... <table> <tr> <td width="130px" valign="top"><form name="nav"><select name="platform" id="platform" onChange="document.location.href=document.nav.platform.options[document.nav.platform.selectedIndex].value"> <option>Platform</option> <? $result = mysql_query("SELECT * FROM Platform"); while($row = mysql_fetch_array($result)) { ?> <option value="?ptfm_ctrl=1&ptfm_id=<?=$row['id_platform']?>" <? if ($_GET['ptfm_id']==$row['id_platform']) { ?>selected="selected"<? } ?>><?=$row['platform']?></option> <? } ?> </select></form></td> <? if (isset($_GET["ptfm_ctrl"])) { ?> <tr> </table> The new solution generates the type ahead result like this... <div> <form> <div> Start typing the name of the product, select the correct title when it appears: <br /> <input type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList"> </div> </div> </form> </div> How can I initiate the search using the second method?
  6. Thank you kindly! This works as needed... INSERT INTO Want (id_version,id_customer,id_have,havewant,date_created) VALUES ($id_version,$_SESSION[id_customer],$id_have,CONCAT($id_have,'-',$ridv),'$created')";
  7. I've tried several different versions of this; $havewant = "$id_have"."-"."$id_want"; or this $havewant = "$id_have-$id_want"; I still end up with the resultant of id_have minus id_want.
  8. Thanks for the quick reply! I'm using the variable in a mysql statement, how could I force that inside of the select statement? It looks like this; $query = "INSERT INTO Want (id_version,id_customer,id_have,havewant,date_created) VALUES ($id_version,$_SESSION[id_customer],$id_have,$havewant,'$created')"; One other thing, I noticed that you changed the variable name from havewant to haveWant, any reason? Personal preference or something I missed!? Thanks again.
  9. First project in php and mysql, I've searched but can't find the answer to stringing together two numbers and a "-" without php giving me the results as it thinks I'm creating an equation. I need the string as text. Example, I need the following as a text string, id_have (INT) and id_have (INT) joined together as id_have-id_want, or, as they will be numbers, 23-45. When I use this; $havewant = $id_have . "-" . $id_have; The result will be $id_have (23) minus $id_want (45), I get -22, not what I'm looking for!!! I need the text string of "23-45" to store in a table. 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.