Jump to content

HPWebSolutions

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Everything posted by HPWebSolutions

  1. The following is from the PHP.NET reference: By using MYSQL_BOTH (default), you'll get an array with both associative and number indices. Using MYSQL_ASSOC, you only get associative indices (as mysql_fetch_assoc() works), using MYSQL_NUM, you only get number indices (as mysql_fetch_row() works). For more information on this, see http://us.php.net/mysql_fetch_array
  2. I should point out, in case you aren't familiar with it, the format (logical_expression?value1:value2) is called the ternary expression. If logical_expression evaluates to true, value1 will be the output of the statement, otherwise if false then value2 will be the output.
  3. Hi Upperbid, Can you tell me what selected_'.$st1++.' is for, I think it may be incorrect here. If you want it to display the value the user selected before submitting the form, you would do something like this: (note, if you are using the "get" action instead of "post", replace $_POST WITH $_GET) print '</select><b>.</b><select name="taxpersf" type="text">'; $st = 0; $st1 = 0; $st2 = 0; while ($st2 <= 99) { print '<option value="'. $st++.'" selected_'.$st1++.' '.($_POST['taxpersf']==($st)?"selected='selected'":"").'>'.$st2++.'</option>'; print " "; }
  4. The above solution is good if you want to determine if the input date is the current date, but not to determine if it is a past date since it may also be a future date. You can use strtotime to extract a timestamp from the input date and then compare the timestamps of the input date and the current date. Here is a simple solution: $new_date = strtotime('Friday 26 June 2009'); $current_date = strtotime(date('l j F Y')); if($new_date < $current_date) echo 'input date is a previous date'; elseif($new_date > $current_date) echo 'input date is a future date'; elseif($new_date == $current_date) echo "input date is today's date";
  5. That is very weird. Can you send me the code that displays the form?
  6. Call $num = preg_replace('/[^0-9]/','',$num); on each row where $num is a single entry.
  7. Hi chawkimatta, You would use JavaScript's XML parsing methods: var xmlDoc = request.responseXML; var field1 = xmlDoc.getElementsByTagName('field1'); var field2 = xmlDoc.getElementsByTagName('field2');
  8. A quick google for "php render website html" turned up this nifty little piece of PHP goodness: http://www.tufat.com/s_html2ps_html2pdf.htm. It seems that it renders a website and returns it in pdf or ps format. Alternatively, you could write a script (probably not in PHP) that listens on a certain port for requests, and when one comes in it loads the website, performs a screen shot, and returns it as an image, somewhat like browsershots.org does.
  9. Hi NeMoD, Exactly what error are you getting? Please post what you see when you click the submit button. The script is working fine for me, other than the db insert which I didn't use. Double and triple check that the $uploadfile path is correct and that you have write permissions for the directory and make sure the filename for the form is add.php as you have written in your opening form tag. Somewhat related, you may want to read up on secure file uploading at http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/ if this is going to be an internet facing web form.
  10. First, is it correct that your second input field has an id of product and your second has an id of quantity? Are they not both quantity fields? If I'm understanding your question correctly, all you would need to do is output the value of $_POST[product[PRODUCT_NUM]] in the value attribute for quantity. I.E.: <input id="quantity" name="product[ABC-8565]" type="text" size="2" value="<?php echo $_POST['product['.$row1['sku'].']']; ?>" /> Remember to properly escape the post data before outputting it to the client.
  11. I've been using WebCeo for a little while, so far I like its features. There's a free version on their site at http://www.webceo.com/download/. I wrote a PHP script that parsed the google results and found the web site's position a few months ago but google must have changed something because it doesn't work anymore, and I don't have the time right now to fix it. If I can find the time to get it working I'll share it with you. Edit: Please pm me if you know the rules for putting a link in the tag. The standard link doesn't seem to work for me.
×
×
  • 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.