Jump to content

LooieENG

Members
  • Posts

    236
  • Joined

  • Last visited

    Never

Everything posted by LooieENG

  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?
  13. Oh, sorry. What I kinda meant was you type in an email on a site something@domain.com then you go to domain.com, type "something" in a textbox, and you can read all the emails sent to that address without having to sign up
  14. Anyone know if there is any, or how easy/hard it would be to write one? I don't wanna make a site like mt2009 (.com), just want it for personal use. I don't know much about PHP so if you could name a few functions that would be used, I'll look into them. Thanks.
  15. <link href="../styles/default/main.css" rel="stylesheet" type="text/css" /> Won't work My page is here root/dir/page.php and the stylesheet is located here root/styles/default/main.css Any ideas?
  16. I don't want it to be text as I'll be using BBCode for that. The htmlentities/decode is so people can have quote marks in their name and signature without it ruining MySQL queries or HTML output. Sorry if I didn't explain it clearly enough
  17. Woops, yeah. Always worked for me (when I do it right) What's the better way, I'd be happy to know. (once you solve this guy's problem) Thanks
  18. Ah <?php $result = mysql_query("SELECT * FROM tablename ORDER BY Name"); $row = mysql_fetch_array($result); for ($i = 1; $i < mysql_num_rows($result); $i++) { if ($row['Usergroup'] == 1) { // do stuff } } ?>
  19. <?php $result = mysql_query("SELECT * FROM tablename WHERE Name = 'can:view:cat:1'"); $row = mysql_fetch_array($result); if ($row['Usergroup'] == 1) { // do stuff } ?> Is that what you mean?
  20. But even if they use <b >text</b >, I'll use htmlentities so it'll be <text> and display as < b>text< /b> instead of text won't it? Then I use html_entity_decode when I put it into the database to save space. And encode when I retrieve from the database.
  21. And when inserting into the database mres(html_entity_decode()) or html_entity_decode(mres()) ?
×
×
  • 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.