Jump to content
Larry Ullman's Book Forums

dickm

Members
  • Posts

    29
  • Joined

  • Last visited

dickm's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. No errors are reported by MYSQL. I just added your error check and no errors. Also I have echoed the variables and they are the same as the static data, so I am really puzzled.
  2. I have the following query which when pasted into phpmyadmin sql works and returns results SELECT h.rec_id AS CapLog, h.remoteid AS Reference, h.branch AS Branch, h.dtplnprtd AS PrelimDate, h.estimate AS Estimate, h.cname AS Company, h.mycustomer AS OurCustomer, CONCAT_WS( ' ', RTRIM( h.jobsite1 ) , RTRIM( h.jobsite2 ) , RTRIM( h.jobsite3 ) , RTRIM( h.jobsite4 ) , RTRIM( h.jobsite5 ) , RTRIM( h.jobsite6 ) , RTRIM( h.jobsite7 ) ) AS Jobsite, h.contractor AS Contractor FROM history h INNER JOIN customer c USING ( cusid ) WHERE c.username = 'USERCPO' AND h.dtplnprtd BETWEEN '20110524' and '20110622' ORDER BY mycustomer ==================================================================================================================== Now the same query but using the variables instead of the static data in RED above returns no results in my script file??? $query = "SELECT h.rec_id AS CapLog, h.remoteid AS Reference, h.branch AS Branch, h.dtplnprtd AS PrelimDate, h.estimate AS Estimate, h.cname AS Company, h.mycustomer AS OurCustomer, CONCAT_WS( ' ', RTRIM( h.jobsite1 ) , RTRIM( h.jobsite2 ) , RTRIM( h.jobsite3 ) , RTRIM( h.jobsite4 ) , RTRIM( h.jobsite5 ) , RTRIM( h.jobsite6 ) , RTRIM( h.jobsite7 ) ) AS Jobsite, h.contractor AS Contractor FROM history h INNER JOIN customer c USING ( cusid ) WHERE c.username = '$remcode' and h.dtplnprtd BETWEEN '$dbegin' and '$dend' ORDER BY mycustomer"; Any ideas as to what is wrong would be appreciated.
  3. Sorry Larry, the correct URL is http://localhost/form/AZCondFinRel.php . This the URL that appears as I am in the development stage with XAMPP. The program that calls this module is in the root folder for the website.
  4. It will be impossible for me to use absolute paths instead of releative, because I will be loading and display hundreds of forms for the user and these will be all in various directories. To use absolute would be a nightmare in testing using Localhost and then the actual live URL. Any other options??
  5. I have changed this non-working code around from the previous that was submitted above. Now a new window is being opened, but errors with "Internet Explorer cannot display the webpage" The correct URL is showing in the browser address bar. <form action="./form/AZCondFinRel.php" onsubmit="window.open(this.action,'popupwin','width=1000,height=700,left=500,top=5,scrollbars=yes,resizable=yes');return false;" method="post" > If I remove the onsubmit command and attributes, the form opens correctly but in existing window. So still puzzled.
  6. Having a problem with opening an addition window. This next coding portion is working correctly and opening the href in a new window. <td><a href="form_selection.php" onClick="window.open(this.href, 'popupwindow2','width=1100,height=800,left=500, top=50, scrollbars=yes,resizable=yes');return false;"><h4> Select and Prepare New Legal Form </h4> </a></td> =============================================================================== Now this segment of coding from a form is not working. The form action is opening the correct php page, but it is not opened in a new window as desired. Can anyone see what is wrong as it is basically the same as the href process. I have changed dimensions, I have changed "this.form.action" to many different variations with spaces, quotes, brackets, etc, but the page is ran correctly, just not in a new window. <form method="post" action="/form/AZCondFinRel.php" onSubmit="window.open( this.form.action,'popupwin','width=1000,height=700,left=50,top=5,scrollbars=yes,resizable=yes');return false;" > Mahalo
  7. Thanks Paul; Printing out the results helped me track down my problems which were multiple. Two of the variables were not updating correctly from the previous POST and two were just my stupid misspelling. Now have the process working correctly. Mahalo
  8. This is driving me crazy. The echo statements for testing are returning the correct where condition variables but the columns are not updated in the table $query = ("UPDATE forms SET form_date = NOW(), form_amount = $camt, form_dispamt = $damt WHERE form_cusid = '$cusid' AND form_recid = '$rec_id' AND TRIM(form_type) LIKE '$afrmtype'"); $result = mysql_query ($query); // Run the query. echo ' Form ID: '. ' [<b>' .$frmid. ' </b> ]'; // this is the correct record id which is an auto-increment value echo ' Number of Rows: '. ' [<b>' .$num_rows. ' </b> ]'; // this is returning a count of 1 record Any help would be greatly appreciated. I have tried it with '$camt' for the SET variables and have tried the ".$camt." also and nothing has changed. The all give the same echo results but not update of data. Mahalo
  9. Okay, I have modified my code based on Larry's process on page 550, but am getting the error: //Warning: mysql_fetch_array() expects parameter 2 to be long, string given in C:\xampp\htdocs\preview_setup_AZ_state_form.php on line 343. Line 343 is the while condition line. I can't rely on post I don't think, because my user editing option occurs a few screens later, when they have an option to make changes based on a new display of information so that is why is am using SESSION instead of POST. Any suggestions for corrections would be appreciated. <p><b>Signee to use for this form: </b> </p><br /> <?php require_once ('./php/mysql_connect.php'); // Connect to the db. $cusid=$_SESSION['cusid']; $query="SELECT relcusid, concat(authsign,'-',signtitle) as mysig FROM relsignor WHERE relcusid=$cusid"; $result = mysql_query ($query); if (mysql_num_rows($result) > 0) { while($row=mysql_fetch_array($result, mysql_num )) { echo '<option value=\"$row[0]\"'; if ($_SESSION['my_sig'] == $row) {echo 'selected="selected"'; echo ">$row[1]</option>\n"; } } } Mahalo
  10. Larry, after rereading and then studying your Sticky form process in PHP6 and MYSQL 5 Visual Quickpro Guide, I made the following corrections to my code and the radio button process is now working correctly for me. I first eliminated all the variable creation at the start and eliminated all the if else conditions that were working with the new variables that I created and just used what was already stored session variables from the original form. <p><b>Joint Check You Selected to:</b> <p> <input type="radio" name="jtchkname" <?PHP if ($_SESSION['jt_cknam']== 'none') {echo 'checked="checked"';} ?>/>None</p> <p> <input type="radio" name="jtchkname" <?PHP if ($_SESSION['jt_cknam']== 'mycustomer') {echo 'checked="checked"';} ?>/>My Customer</p> <p> <input type="radio" name="jtchkname" <?PHP if ($_SESSION['jt_cknam']== 'contractor') {echo 'checked="checked"';} ?>/>Contractor</p> <p> <input type="radio" name="jtchkname" <?PHP if ($_SESSION['jt_cknam']== 'lender') {echo 'checked="checked"';} ?>/>Lender</p> <p> <input type="radio" name="jtchkname" <?PHP if ($_SESSION['jt_cknam']== 'owner') {echo 'checked="checked"';} ?>/>Owner</p> <p> <input type="radio" name="jtchkname" <?PHP if ($_SESSION['jt_cknam']== 'other') {echo 'checked="checked"';} ?>/>Other Name</p> <P> I just have to learn to read more intelligently and follow your great examples, but thought I would pass this on to maybe help others. Mahalo
  11. Here is the code that I have and on the first page that it appears, it allows the user to select only one of the options. However, when I return the full form for further editing by the user of all form items, this second of code always returns the checked option of 'owner'. The default option on the first page is 'none' and even if left at that, on the review page is is 'owner'. Any suggestions would be great. ==========First page code======= <p><b>Joint Check to Who:</b> <p> <input type="radio" name="jtchkname" value="none" checked="checked"/>None</p> <p> <input type="radio" name="jtchkname" value="mycustomer"/>My Customer</p> <p> <input type="radio" name="jtchkname" value="contractor" />Contractor</p> <p> <input type="radio" name="jtchkname" value="lender"/>Lender</p> <p> <input type="radio" name="jtchkname" value="owner"/>Owner</p> <p> <input type="radio" name="jtchkname" value="other" />Other Name</p> </p> ==========Review page code======= <?PHP $none_status = "unchecked"; $mycustomer_status = "unchecked"; $contractor_status = "unchecked"; $lender_status = "unchecked"; $owner_status = "unchecked"; // session jt_cknam is created from the post of jntchkname from first page if ($_SESSION['jt_cknam'] == 'none') { $none_status = "checked"; } else if ($_SESSION['jt_cknam'] == 'mycustomer') { $mycustomer_status = "checked"; } else if ($_SESSION['jt_cknam'] == 'contractor') { $contractor_status = "checked"; } else if ($_SESSION['jt_cknam'] == 'lender') { $lender_status = "checked"; } else if ($_SESSION['jt_cknam'] == 'owner') { $owner_status = "checked"; } //} ?> <p><b>Joint Check to Who:</b> <p> <input type="radio" name="jtchkname" value="none" checked = '$none_status'/>None</p> <p> <input type="radio" name="jtchkname" value="mycustomer" checked = '$mycustomer_status' />My Customer</p> <p> <input type="radio" name="jtchkname" value="contractor" checked='$contractor_status'/>Contractor</p> <p> <input type="radio" name="jtchkname" value="lender" checked = '$lender_status '/>Lender</p> <p> <input type="radio" name="jtchkname" value="owner" checked = '$owner_status'/>Owner</p> <P> Mahalo
  12. I am having trouble trying to control the amount of data that a user can enter in a textarea on a form. The code (just a small segment of the full page form that I have is as follows: <hr /> <p><b>Special Notes Regarding this form information: </b></p> <p><textarea cols="45" rows="5" name="comments" wrap="hard"> </textarea></p> <br /> <hr /> I have the limit set at 5 rows, but when typing in the area, the user can continue on and on and this will be unacceptable. I have thought of a message to say only type on the first 5 lines, but that doesn't seem to be very professional. Any help would be appreciated Mahalo,
×
×
  • Create New...