Jump to content

kenrbnsn

Staff Alumni
  • Posts

    8,234
  • Joined

  • Last visited

Everything posted by kenrbnsn

  1. Please don't hijack other threads, even if you're having the same problem. Please post more of your code, sometimes the error can be in a line a few lines above where PHP notices the problem. Ken
  2. What does your query look like? Ken
  3. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=328735.0
  4. This has nothing to do with PHP, moving it to the Javascript area. Ken
  5. As written, that function can't work. The arrays $arr & $arg would not be defined inside the function. If you're going to ask a question like this, post the real code. Ken
  6. You'll probably get a quicker answer to this question in the Google Maps group Ken
  7. Simple answer --- you can't. Once the email leaves your server there is very little you can find out about it. Complex answer --- You can put a Delivery Status Notification header in your email, but the user has control over whether the response is sent. See RFC 1891 for all the details. Ken
  8. Please show us your code between tags. Ken
  9. You need to use sessions. In all scripts where you want to use sessions, put <?php session_start(); ?> at the start of the script before any output is generated. In the original page, you need to created the session variable: <?php $_SESSION['total'] = $total; ?> On the page where you want to get that value: <?php $total = $_SESSION['total']; ?> Ken
  10. Since you're only doing the resize if the type of the uploaded file matches, then the type that's being passed from IE is not matching. I have a short script that uploads files and tells you the type of the uploaded file. <html> <head> <title>Test Upload</title> </head> <body> <?php if (isset($_POST['submit'])) { echo '<pre>' . print_r($_POST,true) . '</pre>'; echo '<pre>' . print_r($_FILES,true) . '</pre>'; } ?> <form action="" method="post" enctype="multipart/form-data"> <p> <input type="file" name="filename"> <input type="submit" name="submit" value="Upload"> </p> </form> </body> </html> You can see it in action at: http://rbnsn.com/phpfreaks/test_upload.php Ken
  11. What are you trying to do, exactly? To change the maximum execution time, use the function set_time_limit() Ken
  12. Where is the form located?
  13. Isn't that what you want? Ken
  14. To make a form post to itself, you just don't put a script name in the action attribute: <form method="get" action="?p=checkout"> Ken
  15. No, that loop will write out "I AM THOMAS" & "HELLO WORLD" alternating. Use this instead <?php require ("config.php"); exec("mode com3: BAUD=9600 PARITY=n DATA=8 STOP=1 to=off dtr=off rts=off"); $fp =fopen("com3", "w"); fwrite($fp,"I AM THOMAS"); while (true) { fwrite($fp,"HELLO WORLD"); } fclose($fp); // this line will never be executed ?> This code will stop after 30 seconds, since that is the default maximum time a PHP script can run. Ken
  16. You're missing a closing ")" on this line: <?php if(mail($strTo, $strSubject, $strBody){ ?> it should be <?php if(mail($strTo, $strSubject, $strBody)){ ?> BTW, when posting code, please put the code between tags. Ken
  17. You could us the "in" operator in your query: <?php $rs_duplicate = mysql_query("select count(*) as total from users where user_name in ('$name','$name2','$name3') ") or die(mysql_error()); ?> Ken
  18. You need to have the correct HTML markup for this to work: <textarea style= "width: 100%" rows="10"> </textarea> Ken
  19. Since you are using the variable $browser to refer to the class, you need to use <?php echo "Using: $browser->Name $browser->Version" ; ?> If you had named your variable $Browser, the original code would have worked. Ken
  20. Take a look at the function array_values(). ksort() will not give the OP the results that he wants. The OP doesn't really want a sort, but to renumber the primary keys. Ken
  21. What you could do is what Drupal does... Store the new pages in a database. When they are requested, by referring to the id of the record, you could write the contents out to a temporary file, include that file, and then delete the temporary file. You could use eval() on the stored code instead. Hopefully, your code makes sure that the submitted code is free of any code that could cause problems. Ken
  22. No <?php $minprice = $_GET['price']['min']; ?> Ken
  23. You can use the function sprintf(): <?php $str = '00.00'; echo sprintf("%2.2f",$str); ?> Ken
  24. This pattern will catch either ",0" or ",1": <?php $pattern2 = "{\,(0|1)+}"; ?> To trim off the zero at the beginning, you can use the ltrim() funtion: <?php $str = '0x.xx'; echo ltrim($str,'0'); ?> Ken
×
×
  • 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.