Search found 31 matches

by monkeymafia
Sat Dec 01, 2007 8:55 am
Forum: Databases
Topic: PHP/MySQL Query Problem!
Replies: 7
Views: 735

thanks for the replies.
by monkeymafia
Thu Nov 29, 2007 8:37 am
Forum: Databases
Topic: PHP/MySQL Query Problem!
Replies: 7
Views: 735

arghh!

so is there no way to execute a similiar query using version 4?
by monkeymafia
Thu Nov 29, 2007 8:08 am
Forum: Databases
Topic: PHP/MySQL Query Problem!
Replies: 7
Views: 735

thanks for the reply. its stating that theres a problem with the actual query:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WEEK)' at line 2

Not too sure whats wrong with the query though?
by monkeymafia
Thu Nov 29, 2007 6:43 am
Forum: Databases
Topic: PHP/MySQL Query Problem!
Replies: 7
Views: 735

PHP/MySQL Query Problem!

hi all trying to execute a query and display items that have been updated within the past week. am pretty sure the query itself is correct but its throwing the following error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/kumar/public_html/Storm Broadban...
by monkeymafia
Wed Nov 07, 2007 9:58 am
Forum: PHP - Code
Topic: Form Validation
Replies: 3
Views: 343

its okay i figured it out. thanks :lol:
by monkeymafia
Wed Nov 07, 2007 9:25 am
Forum: PHP - Code
Topic: Form Validation
Replies: 3
Views: 343

Form Validation

Hi I am trying to validate my form. Ive read a few books and none tell you how to validate a form before it gets sent to a database. how would I go about validating my form. I want to it to be client side validation using javascript. this is the code i have for inserting data into database via form:...
by monkeymafia
Wed Nov 07, 2007 9:25 am
Forum: PHP - Code
Topic: Form Validation
Replies: 0
Views: 106

Form Validation

Hi I am trying to validate my form. Ive read a few books and none tell you how to validate a form before it gets sent to a database. how would I go about validating my form. I want to it to be client side validation using javascript. this is the code i have for inserting data into database via form:...
by monkeymafia
Thu Oct 25, 2007 1:09 pm
Forum: PHP - Code
Topic: session not working
Replies: 11
Views: 1746

thanks for the reply. this is my code i have placed for the login page: <?php session_start(); include 'dbconnect.php'; if(isset($_POST['submit'])) { if(mysql_num_rows(mysql_query("SELECT fk_memberid, password FROM members WHERE fk_memberid = '".$_POST['username']."' && passwo...
by monkeymafia
Thu Oct 25, 2007 4:34 am
Forum: PHP - Code
Topic: session not working
Replies: 11
Views: 1746

hey stryks. i restructured the code which eliminates the need for ob_start. but still no luck redirecting non logged users to logged in page. that aside. i looked into the hashed passwords. Am i right in thinking that I would actually have to send the passwords using md5. via a php form. for example...
by monkeymafia
Thu Oct 25, 2007 4:27 am
Forum: PHP - Code
Topic: header location problem
Replies: 6
Views: 911

thanks i reorganized it the first time you suggested :wink: it was horrible and unreadable before 8O
thanks again!
by monkeymafia
Wed Oct 24, 2007 6:13 pm
Forum: PHP - Code
Topic: session not working
Replies: 11
Views: 1746

thanks for the reply. if i use the code you presented i get the following error when logging in: Warning: Cannot modify header information - headers already sent by (output started at /home/kumar/public_html/Storm Broadband/myaccount.php:15) in /home/kumar/public_html/Storm Broadband/myaccount.php o...
by monkeymafia
Wed Oct 24, 2007 5:56 pm
Forum: PHP - Code
Topic: session not working
Replies: 11
Views: 1746

its still not working. ive placed the code in the useraccount.php like so: <?php session_start(); ob_start(); if (!isset($_SESSION['logged']) || $_SESSION['logged'] !== true) { // not logged in, move to login page header('Location: myaccount.php'); exit; } session_write_close(); ob_end_flush(); ?> h...
by monkeymafia
Wed Oct 24, 2007 3:38 pm
Forum: PHP - Code
Topic: session not working
Replies: 11
Views: 1746

session not working

Hi i have a login form , once logged in it takes the users to another page (useraccount.php). ive set the session, however i can still access useraccount.php without logging in. why is this happening login form code: session_start(); include 'dbconnect.php'; if(isset($_POST['submit'])) { if(mysql_nu...
by monkeymafia
Wed Oct 24, 2007 12:28 pm
Forum: PHP - Code
Topic: login script
Replies: 7
Views: 508

thanks that sorted it. i forgot to add the password.

ive prevented sql injection on my insert statements e.g.

Code: Select all

VALUES ('" . mysql_real_escape_string($userid) . "', '" . mysql_real_escape_string($subject) . "',...
but how would i apply them to my login script?
thanks again
by monkeymafia
Wed Oct 24, 2007 11:14 am
Forum: PHP - Code
Topic: login script
Replies: 7
Views: 508

yes same response.