Search results

  1. as4s1n

    Private Message form - friends list

    That's a pretty good point, although, I don't really want to go back through all my code and change that. A good habit to form I suppose.
  2. as4s1n

    Private Message form - friends list

    Wouldn't that be their fault and have no connection to me if they make a typo, which would be easy to fix anyway? I use notepad XD so no editor to write it in for me.
  3. as4s1n

    How can I stop a user from viewing a page unless they are redirected there?

    I'm sorry, I forgot something. I realise that if you have say 4 or 5 or more variables that the if statement may get cluttered, # Bad: if(empty($var1)||empty($var2)||empty($var3)||empty($var4)||empty($var5) #etc.) you may choose to run a foreach loop and check each. But for this to work...
  4. as4s1n

    How can I stop a user from viewing a page unless they are redirected there?

    Simply use the ternary operator when defining the variables and check the isset: # ... $var1 = (isset($_POST['varName1'])) ? $_POST['varName1'] : ''; # Define var 1 $var2 = (isset($_POST['varName2'])) ? $_POST['varName2'] : ''; # Define var 2 # Etc. # Check if the value is empty...
  5. as4s1n

    ereg_replace and explode problem

    The trim() method cuts out whitespace. Try: $input_array = explode(" ", trim($clean_input)); Also for the special characters you could try htmlspecialchars() which turns the values into html characters, for example a space ' ' would be %20 and it would come out in html as a ' ' still
  6. as4s1n

    Private Message form - friends list

    Cool, thanks. I had no idea about the window.opener. Say, do you know of a good JS tutorial, obviously I need to learn more. Your loop if() checks whether they are checkboxes, not whether they are checked or not so it returns every checkbox value. I changed it to // ... if(inputs[i].type...
  7. as4s1n

    PHP registration script - Username check does not work

    Does that mean that it would be better to replace while($row=$query->fetch()) with foreach when returning rows or is that only good for returning one select column of data?
  8. as4s1n

    Private Message form - friends list

    So, if I wanted to get all of the checked boxes I would do something like: function returnFriends() { // Page that used window.open input to field var inputField = window.opener.document.forms.friendsList.elements.getElementById("name"), // Checked boxes on this page //...
  9. as4s1n

    Private Message form - friends list

    On my write message (PM) form I want the users to click on a link and a window would pop up with all their friends names' inside. I want them to click on a checkbox next to their name for all the friends they want to send it to and when they close it (via button on the bottom) the names are...
  10. as4s1n

    PHP registration script - Username check does not work

    That would probably be more than I would want to write, I would simplify it to this $sth->execute(array($_POST['name'])); Thanks for the help, it finally works without flaw.
  11. as4s1n

    PHP registration script - Username check does not work

    Thanks, it works now... Now can you explain how that works? You defined a variable inside the array variable. Is that correct. And why do you need to use {$name} for that? Also, how do I call those variables onto the script? Is it $info['$name'] or something?
  12. as4s1n

    PHP registration script - Username check does not work

    Here is what I get if I use my first section of code: And if I use the second set: @Misson: If I used the array_intersect_key() method you talked about, which two arrays would I be comparing? Would it be something like: $sth->prepare("... :name")...
  13. as4s1n

    Server side includes

    Isn't it both? Cuz the little I know about ASP is includes
  14. as4s1n

    Server side includes

    I don't know whether it's hard per se, it's just more work than I really wanted to do.
  15. as4s1n

    Server side includes

    Yes, ASP works on this host but it's a tricky setup. I don't want to bother with it so I just use PHP but you will have to look around to find it.
  16. as4s1n

    Server side includes

    Are you talking about php includes? Yes of course they have those here.
  17. as4s1n

    PHP registration script - Username check does not work

    Still the same problem. Misson always tells me to do it like that but just to be safe I changed it to this: $sth = $dbh->prepare("SELECT id FROM users WHERE username = ?"); $sth->execute(array($_POST['name'])); Still the same problem
  18. as4s1n

    PHP registration script - Username check does not work

    I wrote a script for a registration page and all of a sudden it just stopped working. Whenever I try something it either reads "Username is taken" even when it isn't and if it doesn't show anything I get either an error (on a separate file) that tells me "Invalid parameters, incorrect number of...
  19. as4s1n

    Why are other programming languages used when all I need is HTML please?

    You use HTML to write the basic structure of the website, you use CSS (Cascading Style Sheets) to style elements so it looks better and to arrange HTML elements for an aesthetically pleasing design, and you use JavaScript to bring it to life (interactivity). You use PHP/ASP to make it dynamic...
  20. as4s1n

    Need to design a 'post comment page'

    If you didn't understand something, I highlighted all of misson's corrections. Sorry, those were a few imperfections, while not critical, it makes it easier to read and manage. First, although it was implied, you should put the database connection handler ($dbh) on the index or on a separate...
Top