Jump to content

kenrbnsn

Staff Alumni
  • Posts

    8,234
  • Joined

  • Last visited

Everything posted by kenrbnsn

  1. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=329079.0
  2. 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
  3. A blank action in a form automatically gets submitted back to the same script. Ken
  4. What happens when you put non CSS code in a CSS file and bring it into you HTML? Ken
  5. Please post the PHP code between tags that's causing the problem. Without seeing your code, we really can't help you. Ken
  6. 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
  7. 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
  8. 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
  9. 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
  10. You need to put <?php session_start(); ?> in every script where you use sessions. Ken
  11. Code? It's hard to diagnose problems without seeing your code. Please post it between tags. Also post the error message. Ken
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=328756.0
  18. This is Javascript, not PHP. Why did you post in the PHP area? Moving this to the Javascript area. Ken
  19. 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
  20. How is the database field defined? Ken
  21. This rar a -sfx7z.sfx test.exe helpdesk.txt; is not a valid PHP statement. Take a look at exec() or shell_exec() Ken
  22. Please post your code between tags. 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.