kenrbnsn
Staff Alumni-
Posts
8,234 -
Joined
-
Last visited
Everything posted by kenrbnsn
-
This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=329079.0
-
Put your queries into variables so you can echo them out when you get an error, this way you will know which query caused the error. Something like this: <?php $q = "SELECT * FROM pages WHERE subject_id = {$row['id']}"; $rs = mysql_query($q) or die("Problem with the query: $q at line " . __LINE__ . '<br>' . mysql_error()); ?> Ken
-
I am gonna pull my EYES OUT!!!! What is wrong here???????
kenrbnsn replied to Bl4ckMaj1k's topic in PHP Coding Help
A blank action in a form automatically gets submitted back to the same script. Ken -
Please post the form. Ken
-
That is telling us that the session variable $_SESSION['myusername'] was created with a blank value. You have to go back to the script that assigns that value to see where the problem is. Ken
-
You can also try using the optional fifth parameter to the mail() function: <?php $to = 'name@domain.com.au'; $header = 'MIME-Version: 1.0' . "\r\n"; $header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $header .= "From: Name <noreply@domain.info>" . "\r\n"; $subject = "Interest registered"; $message = "<!DOCTYPE HTML.. a bunch of html"; $fifthp = '-f noreply@domain.info'; mail($to, $subject, $message, $header,$fifthp); ?> Ken
-
Do <?php if (isset($_SESSION)) { echo '<pre>' . print_r($_SESSION,true) . '</pre>'; } ?> This will show you what's in the session array. Post it. Ken
-
The "\n" is not the newline on the browser display. To the browser, that character is another whitespace character. To get a newline on the browser, you need to use the HTML tag "<br>". If you had looked at the source, you would have seen the newline between those strings: <?php $str = "my string"; $str1 = "my other string"; echo $str; echo "<br>"; echo $str1; ?> or <?php $str = "my string"; $str1 = "my other string"; echo "$str<br>$str1"; ?>[code] Ken
-
You need to put <?php session_start(); ?> in every script where you use sessions. Ken
-
I ran your code through "php -l" (php lint to check for errors) and the error I got was Line 25 is <?php if (isset($_POST['username'] == '***') && ($_POST['password'] == '***')) { ?> You are missing a closing ")" for the "isset" function. This line should be written as <?php if (isset($_POST['username']) == '***' && $_POST['password'] == '***') { ?> I don't know what you're using as an editor, but get yourself one that shows matching "( )" and "{ }" at the very least. Ken
-
If you don't validate on the server side, you will be sorry. PHP is running on a server that is usually much more powerful than your browser which is running the Javascript code. If you code your PHP smartly, you may not have to use many if statements, you might be able to use switch statement or something else. If you show us your real form, since the one you posted has only one field, we might be able to suggest some efficient code. Ken
-
Works fine for me: <?php $x = 'http://storage.canoe.ca/v1/dynamic_resize/?src=http://www.torontosun.com/specialsections/2011/03/10/248x186_mb.jpg&size=40x30'; $i = getimagesize($x); echo '<pre>' . print_r($i,true) . '</pre>'; ?> yeilds: Array ( [0] => 40 [1] => 30 [2] => 2 [3] => width="40" height="30" [bits] => 8 [channels] => 3 [mime] => image/jpeg ) Why do you say it doesn't work? Ken
-
Actually, using POST is safer than using GET, since it's harder (but not impossible) to manipulate the values being passed to the script when using POST. Also, the number of characters passed to the processing script is limited when using GET. Ken
-
Why don't you just use the MySQL function NOW()? <?php mysql_query("INSERT INTO messages (reciever, sender, subject, message, date) VALUES ('$reciever', '$user', '$subject', '$message',NOW())") or die (mysql_error()); ?> Ken
-
This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=328756.0
-
This is Javascript, not PHP. Why did you post in the PHP area? Moving this to the Javascript area. Ken
-
Problem with concenating a string for some reason.
kenrbnsn replied to jayhawker's topic in PHP Coding Help
Are you sure this line <?php $firstname = "firstname_ord". " " . "lastname_ord"; ?> didn't have "$" before "firstname_ord" & "lastname_ord"? If there was a "$" preceding those strings, then the old code would have been written at a time when register_globals was enabled. That line would now product the value of "firstname_ord lastname_ord" in $firstname. If you want the value of the text boxes in the form, you would need something like: <?php $firstname = "{$_POST['firstname_ord']} {$_POST['lastname_ord']}"; ?> Ken -
How is the database field defined? Ken
-
This rar a -sfx7z.sfx test.exe helpdesk.txt; is not a valid PHP statement. Take a look at exec() or shell_exec() Ken
-
Please post your code between tags. Ken
-
Problem with concenating a string for some reason.
kenrbnsn replied to jayhawker's topic in PHP Coding Help
What are you getting with each attempt? Ken