-
Posts
236 -
Joined
-
Last visited
Never
Everything posted by LooieENG
-
Beginners syntax and loop questions - help please!
LooieENG replied to Digital Wallfare's topic in PHP Coding Help
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>"; -
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?
-
$yoursnow = mysql_query("UPDATE flags SET mod = '$duuuude' WHERE flagid = '$flaggle'") edit: oh, my bad. missed the mod thing
-
I've looked everywhere and I just can't get my head around it
-
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;
-
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
-
mysql_fetch_array or mysql_fetch_assoc - which is faster?
LooieENG replied to LooieENG's topic in PHP Coding Help
Oh. Is it also true that readfile() is faster than include()? I thought readfile() just returned the number of characters in the file -
mysql_fetch_array or mysql_fetch_assoc - which is faster?
LooieENG replied to LooieENG's topic in PHP Coding Help
Thanks for the answers, just ran a quick test then and assoc is infact faster. -
mysql_fetch_array or mysql_fetch_assoc - which is faster?
LooieENG posted a topic in PHP Coding Help
^^^^^ -
Anyone ever used cheeroke httpd server?
LooieENG replied to roguehosting's topic in Other Web Server Software
What OS/distro are you using? -
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?
-
Email validation as fast and with as little code as possible?
LooieENG replied to LooieENG's topic in PHP Coding Help
Thank you. -
Email validation as fast and with as little code as possible?
LooieENG replied to LooieENG's topic in PHP Coding Help
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()? -
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
-
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.
-
Nvm, my mistake.
-
<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?
-
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
-
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
-
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 } } ?>
-
<?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?
-
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.
-
And when inserting into the database mres(html_entity_decode()) or html_entity_decode(mres()) ?