kenrbnsn
Staff Alumni-
Posts
8,234 -
Joined
-
Last visited
Everything posted by kenrbnsn
-
What does your query look like? Ken
-
This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=328735.0
-
This has nothing to do with PHP, moving it to the Javascript area. Ken
-
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
-
You'll probably get a quicker answer to this question in the Google Maps group Ken
-
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
-
Please show us your code between tags. Ken
-
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
-
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
-
How do I make a loop for my simple PHP coding?
kenrbnsn replied to project168's topic in PHP Coding Help
What are you trying to do, exactly? To change the maximum execution time, use the function set_time_limit() Ken -
Where is the form located?
-
Isn't that what you want? Ken
-
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
-
How do I make a loop for my simple PHP coding?
kenrbnsn replied to project168's topic in PHP Coding Help
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 -
Please explain more. Ken
-
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
-
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
-
You need to have the correct HTML markup for this to work: <textarea style= "width: 100%" rows="10"> </textarea> Ken
-
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
-
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
-
What is a safer way to include an internal webpage to my site?
kenrbnsn replied to FalseProphet's topic in PHP Coding Help
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 -
getting this url variable $GET["price[min]"]
kenrbnsn replied to beanymanuk's topic in PHP Coding Help
No <?php $minprice = $_GET['price']['min']; ?> Ken -
preg_replace remove ,0 or ,1 also remove first zero
kenrbnsn replied to CBG's topic in PHP Coding Help
You can use the function sprintf(): <?php $str = '00.00'; echo sprintf("%2.2f",$str); ?> Ken -
preg_replace remove ,0 or ,1 also remove first zero
kenrbnsn replied to CBG's topic in PHP Coding Help
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