-
Posts
1,807 -
Joined
-
Last visited
Everything posted by hitman6003
-
Confused - Help php data to html table to be sent by mail()
hitman6003 replied to mikeweb's topic in PHP Coding Help
Change all of your vars in the email from <?php echo $varname; ?> to ' . $varname . ': [code]Customer Information<br> Ban: <?php echo $txtBanNum; ?> txtWirelessNum <?php echo $txtWirelessNum; ?><br> txtCustomerName <?php echo $txtCustomerName; ?>[/code] should be: [code]Customer Information<br> Ban: ' . $txtBanNum . ' txtWirelessNum ' . $txtWirelessNum . '<br> txtCustomerName ' . $txtCustomerName . '[/code] -
They are single quotes. You have two options. Use addslashes (http://www.php.net/addslashes) or use mysql_real_escape_string (http://www.php.net/mysql_real_escape_string) on the var that is giving you trouble (not the whole query)
-
Have you looked in the manual? Going to the fsockopen page and doing a search for "post" yielded many results that will proabably answer your question. http://www.php.net/fsockopen
-
Sockets tutorial: http://www.phpfreaks.com/tutorials/50/0.php
-
Confused - Help php data to html table to be sent by mail()
hitman6003 replied to mikeweb's topic in PHP Coding Help
You didn't ask a question. All you did was post some code. What is the problem? Where is the problem in your code? What have you tried to do to fix it? What are the events that cause the problem to occur? -
Problem w/form+drop down menu after query by 3 fields
hitman6003 replied to Arl8's topic in PHP Coding Help
Make sure you do some checking on the user inputs to verify that they are valid input and not an attempt to cause harm to your database. -
Ummm, put an anchor tag around it.... [code]<a href="nextpage.php"><img src="image.png" border="0" /></a>[/code]
-
Problem w/form+drop down menu after query by 3 fields
hitman6003 replied to Arl8's topic in PHP Coding Help
Something like this should work: [code]$query = "SELECT * from tblPatient"; if ( $_POST['lname'] != "") { $where[] = "lname LIKE '%$lname%'"; } if ( $_POST['fname'] != ""){ $where[] = "fname LIKE '%$fname%'"; } if ($_POST['dob'] != ""){ $where[] = "dob LIKE '%$dob%'"; } if (count($where) > 0) { $query .= " WHERE " . implode(" AND ", $where); } $result = odbc_exec($odbc, $query) or die (odbc_errormsg()); $row = odbc_fetch_array($result);[/code] -
You will have to break the word appart to search for it's peices.
-
What about it doesn't work?
-
[code]$q = mysql_query("SELECT * FROM ebb_blacklist WHERE blacklisted_username LIKE '%$value%'") or die(mysql_error());[/code]
-
Here is a tutorial on file uploads: http://www.phpfreaks.com/tutorials/85/0.php And here is one on image uploads specifically: http://www.phpfreaks.com/tutorials/36/0.php
-
I would use a single array, with the prices being the key and the item being the value. Then you can use the ksort (http://www.php.net/ksort) and krsort (http://www.php.net/krsort) functions. As for getting values in an array: [code]<?php $query = "SELECT price, item FROM table"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $price = $row['price']; $data[$price] = $row['item']; } ksort($data); echo '<pre>'; print_r($data); ?>[/code]
-
This line: [code]$headers = "From: support@maxwho.com\r\n" .[/code] and this line: [code]$maxwhoHeaders = "From: $email\r\n" . [/code] Should end in a semicolon, not a period. What's happening is you are concatenating your message body onto your headers, then also including it in the body, so it appears as though the message is being sent twice.
-
VERY EASY QUESTION! comparing two array keys?
hitman6003 replied to bilis_money's topic in PHP Coding Help
Loop through the first array and use array_key_exists (http://www.php.net/array_key_exists) to see if the value is a key. -
You can redirect the user to a different page using the header command, assuming you haven't output anything to the browser: [code]header("Location: nextpage.php");[/code]
-
[code]UPDATE table SET column = column + 5 WHERE id = '$id';[/code]
-
Either of these two should work for you: [code]$grad = array($row['Grad']); $bestigning = array($row['Bestigning']); $score = $grad[0] * $bestigning[0]; echo $score; $score = array($row['Grad'], $row['Bestigning']); echo(array_product($score));[/code]
-
VERY EASY QUESTION! comparing two array keys?
hitman6003 replied to bilis_money's topic in PHP Coding Help
Use array_diff_key (http://www.php.net/array_diff_key) -
That means you are missing a closing curly brace ( } ). Looks like it make be here: [code]if(isset( $_GET['tgartname'] ) ) { $head = 'Terragen'; $subhead = $row_terragenart['terragenname']; ?>[/code]
-
Sorry Barand...I completely missed your post for some reason...didn't mean to reiterate what you said.
-
You are reusing the same variable name twice, so the latter instance will overwrite any earlier values. If you want to know exactly what is being passed in the url parameters, then do a print_r of the $_GET array. [code]echo '<pre>'; print_r($_GET);[/code] Also, use $_POST and $_GET instead of $_REQUEST.
-
[quote]I too now use 5.1.4, and I can't recall this behaviour ("0" evaluating as equal to all strings) in previous versions... [/quote] It doesn't always convert to zero. See here: http://us2.php.net/manual/en/language.types.string.php#language.types.string.conversion