Search found 205 matches
- Sat Aug 24, 2013 5:57 pm
- Forum: Tutorials
- Topic: PHP Tutorial: Register and Login (Split)
- Replies: 17
- Views: 9318
Re: PHP Tutorial: Register and Login (Split)
Are you saying that your file is named index.html? Unless you have your server configured to parse PHP in an HTML file, you will need to rename index.html to index.php. If this is not the case, you are also not displaying any of the $errors that could occur.
- Sat Aug 24, 2013 5:54 pm
- Forum: JavaScript
- Topic: JQuery scrollTop issues for android
- Replies: 5
- Views: 4361
Re: JQuery scrollTop issues for android
Thanks for the suggestion. I will try this after I get off work but at a quick glance, it looks like it will need the scrollTop of the div since it was originally meant for html/body.
- Fri Aug 23, 2013 9:32 pm
- Forum: JavaScript
- Topic: JQuery scrollTop issues for android
- Replies: 5
- Views: 4361
JQuery scrollTop issues for android
It seems android is more annoying than ie when it comes to this (for me at least ;)) The problem is that the JQuery scrollTop works on every device except android when it comes to overflow beind set to auto, or scroll. There is a workaround that is supposed to work, but it seems it doesn't for me. T...
- Tue Aug 20, 2013 10:39 pm
- Forum: Tutorials
- Topic: PHP Tutorial: Register and Login (User Account System) 3
- Replies: 9
- Views: 5832
Re: PHP Tutorial: Register and Login (User Account System) 3
I started learning to spot the little things by reading error messages. Helx has posted a nice thread of how to do some debugging here . It still took me a few weeks to learn how to debug without using it. Everyone has to start from somewhere so don't feel discouraged if you don't pick it up right a...
- Tue Aug 20, 2013 10:27 pm
- Forum: Tutorials
- Topic: PHP Tutorial: Register and Login (User Account System) 3
- Replies: 9
- Views: 5832
Re: PHP Tutorial: Register and Login (User Account System) 3
<?php if (empty($errors)){ $SESSION['username'] = htmlentities($_POST['username']); header('Location: protected.php'); die(); } ?>You are missing the underscore in $_SESSION['username'] here.
- Tue Aug 20, 2013 10:06 pm
- Forum: Tutorials
- Topic: PHP Tutorial: Register and Login (User Account System) 3
- Replies: 9
- Views: 5832
Re: PHP Tutorial: Register and Login (User Account System) 3
Could you post the contents of login.php please? It might just be my eyes not seeing code for a few months but everything seems okay in init.inc.php
- Tue Aug 20, 2013 9:18 pm
- Forum: Tutorials
- Topic: PHP Tutorial: Register and Login (User Account System) 3
- Replies: 9
- Views: 5832
Re: PHP Tutorial: Register and Login (User Account System) 3
<?php // Checks if the Username and Password combination is valid. function valid_credentials($user, $pass){ $user = mysql_real_escape_string($user); $pass = sha1($pass); $total = mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `user_name` = '{$user}' AND 'user_password' = '{$pass}'&qu...
- Tue Aug 20, 2013 9:01 pm
- Forum: Code
- Topic: Contact Form
- Replies: 4
- Views: 3318
Re: Contact Form
You should filter the email contents. I ran into a problem where an email provider I used had failed to filter JavaScript. Hidden fields are also editable. You should collect the ip by php once they submit the form. As for $_SERVER['REMOTE_ADDR'] being echoed unfiltered, Server variables are supplie...
- Sat Jun 29, 2013 9:36 pm
- Forum: Tutorials
- Topic: Private Message System Pt. [08]. Can't insert messages...
- Replies: 8
- Views: 2794
Re: Private Message System Pt. [08]. Can't insert messages..
What is the value of $conversation_id and session id?
- Sat Jun 22, 2013 3:52 pm
- Forum: PHP
- Topic: Php adding remember me function
- Replies: 4
- Views: 2262
Re: Php adding remember me function
Cookies are user editable. If you don't encode the username cookie somehow when setting it (of course able to decode as well) then accounts can be compromised.
- Thu Jun 20, 2013 4:42 am
- Forum: JavaScript
- Topic: button problem
- Replies: 6
- Views: 4279
Re: button problem
Don't forget that you will need to use JQuery for that example.
- Mon Jun 17, 2013 7:41 pm
- Forum: JavaScript
- Topic: Checkbox required
- Replies: 10
- Views: 5103
Re: Checkbox required
This would be done with JavaScript, not PHP. However, you will need to validate it server side either way due to users that might have JavaScript disabled. You can try this with JavaScript. Of course, you're going to need to incorporate it into your code so that the submission returns false if not c...
- Mon May 27, 2013 3:05 pm
- Forum: PHP
- Topic: Getting Data from 3 MySQL tables
- Replies: 3
- Views: 1483
Re: Getting Data from 3 MySQL tables
Sorry I missed the part about friends too. That will only work for the user. I'll look back at this later if no one has the answer for you by then.
- Sun May 26, 2013 2:51 pm
- Forum: PHP
- Topic: Getting Data from 3 MySQL tables
- Replies: 3
- Views: 1483
Re: Getting Data from 3 MySQL tables
Is there any reason why you can't just do like:
<?php session_start(); if($_SESSION['user_id'] == $_GET['user_id']) { // Display } else { // Don't display } ?>
- Sun May 26, 2013 2:50 pm
- Forum: PHP
- Topic: Update Query
- Replies: 3
- Views: 1393
Re: Update Query
I'm not sure what the question is, but if you're using data straight from $_POST without filtering it, you're leaving yourself open to SQL injection. Also, just in case there ever is a SQL injection attack, you're going to want to output your data with htmlentities()
- Sat May 25, 2013 5:12 pm
- Forum: PHP
- Topic: Foreach help
- Replies: 1
- Views: 901
Re: Foreach help
It's actually a lot simpler than one would think :) Here's an example. <?php $array = array("Test" => "successful"); // Just a sample array foreach($array as $key => $value) { echo $key." returned ".$value; // Displays "Test returned successful" } ?>
- Tue May 14, 2013 9:01 pm
- Forum: Code
- Topic: JQuery Chat
- Replies: 6
- Views: 4751
Re: JQuery Chat
Thanks for that jacek ;) I forgot to put credit for your version compare, and there were a few small issues. Typos, noscript stuff, an emote bug, etc. Anyways, I put the updated one up for whomever downloaded that. I'm going to make it OOP at some point but I'm just too busy to completely rework it ...
- Mon May 13, 2013 2:01 pm
- Forum: Code
- Topic: JQuery Chat
- Replies: 6
- Views: 4751
JQuery Chat
EDIT August 24, 2016: So cringe remembering this lol. Well I mean. There were so many bugs in this script. Just re-uploaded a patch for the errors from using my old domain. Viewing this inspired me to update it again. Here's a current, also incomplete list of changes for Version 1.3 along with a pr...
- Wed May 08, 2013 1:16 pm
- Forum: (X)HTML
- Topic: Form not submitting
- Replies: 2
- Views: 2711
Re: Form not submitting
Even without the action it would work. But just for kicks I tried it, and it also did not work.
Edit: I'm an idiot. I forgot forms that use an enter key to submit also require a submit button. Due to my usual handling the form submission by enter key with javascript, I never needed one.
Edit: I'm an idiot. I forgot forms that use an enter key to submit also require a submit button. Due to my usual handling the form submission by enter key with javascript, I never needed one.
- Tue May 07, 2013 1:32 pm
- Forum: PHP
- Topic: Upload image file to two directories php
- Replies: 4
- Views: 1472
Re: Upload image file to two directories php
Resizing images is a several step process. I don't have time to test/write out an explanation, so I'll get you started with this. Look at the example and look up the other functions it uses.
imagecopyresampled()
imagecopyresampled()
- Tue May 07, 2013 1:29 pm
- Forum: (X)HTML
- Topic: Form not submitting
- Replies: 2
- Views: 2711
Form not submitting
So, I have created an extra spam prevention feature to rule out most basic spam bots. Using a text field with display none. The problem is, it works fine with JavaScript enabled, but with it disabled, the form does not submit, as though it was being blocked by JavaScript...but it's disabled. However...