Jump to content

cbrooks

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cbrooks's Achievements

Member

Member (2/5)

0

Reputation

  1. has any one used Microsoft Translator on a site? If so, what was your opinion of it?
  2. What are the general Advantages / Disadvantages to using stored functions for selecting/inserting/updating/deleting records in you databases from your PHP applications? Speed? Security? ????
  3. I understand on the if (answer) { OK, since I'm 'Still Learning' do you mind taking a few minutes and pointing out some of the security risks? The code that I showed was just something simple to allow me to test/learn passing variables back and forth between JavaScript and PHP, not the actual code that I am using in my actual pages.
  4. OK, this is what I came up with: First the javascript function: <code> function testit(Param, id1, id2, id3){ var message ="Are you sure that you want to change the current data?\n" + "Click OK to proceed or Cancel to abort?"; answer = confirm(message); window.location.href = "tshowconfirm.php?which=" + answer + "&picked=" + Param + "&id1=" + id1 + "&id2=" + id2 + "&id3=" + id3; } </code> Next the data input: <code> <?php echo "<td><select name=\"maybe\" id=\"maybe\" onchange=\"testit(this.value, '{$user}', '{$company}', '{$ship_to_nbr}');\">"; ?> </code> and the output from tshowconfirm.php: <code> <?php $update_t_f=$_GET['which']; $selection=$_GET['picked']; $user = $_GET['id1']; $company = $_GET['id2']; $shiptonbr = $_GET['id3']; echo "Update Table : ".$update_t_f."<br />"; echo "Selection is: ".$selection."<br />"; echo "User is : ".$user."<br />"; echo "Company is : ".$company."<br />"; echo "Shipping is : ".$shiptonbr."<br />"; ?> It does work, allows me to input my data, calls the javascript code, then relays 'answer' with data to either update or save to the next php script for final action May not be the prettiest or cleanest code, but for a test it works for me.
  5. Ok, I have a bunch of pages that are working as desired. Reading/displaying info from database. Have a new form where user enters data and then on 'Submit' it digest the data and either inserts a new record or updates an older record. So what is the easiest (and best) method to comfirm that the user 'Does Really' want to update data that is already on file. My initail thought was to use a JavaScript 'confirm(message)' popup, if this is the way to go, how do you pass the return value from the 'confirm(message)' back to your PHP page?
  6. start looking at the code that starts as //for use with my FIRST list box this builds the $List1 which is what you want your page to dispaly then look at the part that starts as <!-- OK a basic form--> on the line that starts <select> delete out onchange="ajaxFunction('LBox2', this.value);" that is the ajax stuff that you don't need. so your line would look like <td><select name="list1" id="LBox1">
  7. unless you are not showing us all of the code, it looks like you are missing a mysql_query statement something like: $result = mysql_query($query) or die(mysql_error()); this statement actually does the insert/update/select action on the database.
  8. Sorry about that, try this http://www.phpfreaks.com/forums/index.php/topic,277549.0.html
  9. look at this code Dynamic DropDown PHP/AJAX. It has several complete examples using and not using MySQL. It is show how to do something else, but the code that you need is there.
  10. That is working just as expected. Thanks
  11. OK, if I understand you correctly, then if I copy the code from the pointed to topic, copy it to my site, run it as is then it should work! I select something from the first drop down and something will then appear in the second drop down allowimg me to select something from it??? If that is what is supposed to happen, then it ain't happening on my end. I tried the version that required no database and then tried the one using a database with same results. My understanding is that I select something from first drop down and it then uses that result to place items in the second drop down????
  12. OK, I got that to work and here is where I am: Just working within the code that you pointed me to: changed their first drop down so that it loads from my database table as per the origninal code that I mentioned. It works ok. Now, when I select a record from the drop down list and click on the 'Submit' button it does load the second drop down list as I require and I can select an item from it. So far so good! Now, I guess my problem now is with the <form> Once I have selected an item from each drop down, then that info needs to be passed to another program which updates another database table with the selected info. This <form> sends to $_POST to its self, so how do I get the info to the next step?
  13. OK, I see where the function is getting the info selected, but 'Just Call Me Slow' but I need you to explain how that gets me anywhere closer to filling in the second dropdown on the fly? Some I need more of a slap in the head and then a very hard push, instead of a gentle bump!!!
  14. I have a input screen where one of the inputs is selected via the following dropdown <code> $query="select customer_nbr, cust_name from web05a"; $result=pg_query($sqlconnection, $query); $rows=pg_num_rows($result); echo "<tr><td align='right'>Associated Company:</td>"; echo "<td><select name='ucompany'>"; for ($i=0;$i<$rows;$i++){ $row=pg_fetch_array($result); $cname=$row['customer_nbr']." : ".$row['cust_name']; echo "<option value='{$row['customer_nbr']}'>$cname</option>"; } echo "</select>"; </code> This dropdown works great, my problem is that I need to have a second drop down immediately following this one whery my db query would depend on the value comming from the first dropdown. my second query would be as follows: $query="select ship_nbr, ship_name, ship_line from web06a where customer_nbr=VALUE FROM THE FIRST DROPDOWN From the resulting table I would then fill in the second dropdown list Help will be appreciated.
  15. Ok, got it all working as follows: I removed the WampServer 2.0i version that I was using and installed WampServer 2.0c in it's place. I then went to the following site: [www.blog.bmedon.net] This site is in a non English language, so click on the 'Translate' Button on the top right to get it in English. and get their copies of the following to dll's php_pdo_pqsql.dll php_pqsql.dll place them into your ext directory enable php_pdo_pqsql.dll and php_pqsql.dll in your php.ini and restart your Apache server. It worked for me the first time. I never heard any info from WampServer personnel concerning this issue. ended up with the following versions of everything: Apache 2.2.8 PHP 5.2.6 MySQL 5.0.51a PostgreSQL 8.2.3
×
×
  • 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.