Jump to content

LooieENG

Members
  • Posts

    236
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    intarwebz (England)

LooieENG's Achievements

Member

Member (2/5)

0

Reputation

  1. I'd do it using single quotes and concatenation 'blah ' . $row['foo'] . ' blah'; If you must use double quotes, I'd use echo "blah {$row['foo']} blah";
  2. Don't use the single quote ' in $row_details[] if it's within double quotes Although an even better way would be echo "<your html='here'>" . $row_details['Telephone'] . "</yourhtml>";
  3. Okay, thanks. I think I understand now (luckily I learned about binary about a month ago in a computing course I'm doing). What I don't understand though, is if you do 4 << 2 What's the significance of the 4 and the 2?
  4. $yoursnow = mysql_query("UPDATE flags SET mod = '$duuuude' WHERE flagid = '$flaggle'") edit: oh, my bad. missed the mod thing
  5. I've looked everywhere and I just can't get my head around it
  6. Ah, thanks for the help but a friend told me yesterday. Forgot to edit this topic. Needed to change this document.login.usernameResponse.innerHTML = ajax.responseText; to this document.getElementById("usernameResponse").innerHTML = ajax.responseText;
  7. index.html <html> <body> <script language="javascript"> function checkUsername(str){ var ajax = new XMLHttpRequest(); ajax.onreadystatechange = function(){ if (ajax.readyState == 4) { document.login.usernameResponse.innerHTML = ajax.responseText; } } ajax.open("GET", "checkUsername.php?q=" + str, true); ajax.send(null); } </script> <form name='login'> Username: <input type='text' onkeyup="checkUsername(this.value);" name='username' /> <div id="usernameResponse"></div> </form> </body> </html> checkUsername.php <?php if ($_GET['q'] == 'test') { echo 'Username exists.'; } else { echo 'Okay!' } ?> Doesn't work
  8. Oh. Is it also true that readfile() is faster than include()? I thought readfile() just returned the number of characters in the file
  9. Thanks for the answers, just ran a quick test then and assoc is infact faster.
  10. I can get sendmail installed and working (I only use it in PHP (mail())) but it says "From: www-data (www-data@localhost.localdomain)" How do I change that?
  11. Ah, I meant sanitse. It'll be for sending confirmation emails for registration, so if they don't enter a proper email that's fine with me Where should I use trim()?
  12. Can I just use mysql_real_escape_string() when they input the email into the data and then use stripslashes when I use mail()? If not, what's the simplest validation with the least/simplest code?
×
×
  • 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.