Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
[MySQL] Fields being blanked out while running queries.
Old 10-22-2007, 04:38 AM [MySQL] Fields being blanked out while running queries.
Novice Talker

Posts: 6
Trades: 0
Oksy I was messing around with mysql trying to make a basic unprotected
login system with a saftey pin. I have it all working apart from the signup form. This is wjat im using for my sign up form:


PHP Code:
<?php

$username 
$_GET['username'];
$password $_GET['password'];
$pin $_GET['pin'];

mysql_connect("localhost""root""password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());

mysql_query("INSERT INTO accounts 
(username, password, pin) 
VALUES ('
$username', '$password', '$pin') ")
or die(
mysql_error());   

echo 
"Data Inserted!";

?>
However me and my friends have been testing it and occasionally we are getting blanks in some of the fields which isnt good. It normally shows a few letters in the a usermane field and in the rest of the password and pin fields on the same row get blanked out like so:



Any help would be great and could you keep in mind that I still need to use the GET function in my signup script as I will be using it in java and vb scripts.
The.Samurai is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-22-2007, 08:42 AM Re: [MySQL] Fields being blanked out while running queries.
Defies a Status

Posts: 1,606
Trades: 0
I once briefly tested a freeware script that would insert blank records when the submit button was pressed with all the data fileds blank. There was no valdiation for the form data.

You did not provide enough information for me to even guess that is your problem. I just wanted to mention it could be.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 10-22-2007, 09:32 AM Re: [MySQL] Fields being blanked out while running queries.
Novice Talker

Posts: 6
Trades: 0
All info was filled in but it wasnt entered in. What info do you need?
The.Samurai is offline
Reply With Quote
View Public Profile
 
Old 10-22-2007, 03:51 PM Re: [MySQL] Fields being blanked out while running queries.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you have nothing in the script to check if the fields are blank.
There is nothing to "sanitise" the data between form and database.
You are using a GET method which send the data in the URL and therefore visible.
Quote:
I still need to use the GET function in my signup script as I will be using it in java and vb scripts
Why?? You can POST data using javascript or vbscript
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-22-2007, 05:08 PM Re: [MySQL] Fields being blanked out while running queries.
Novice Talker

Posts: 6
Trades: 0
I dont know how to post from java or vb and how would i go about checking for blank fields?
The.Samurai is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to [MySQL] Fields being blanked out while running queries.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15594 seconds with 12 queries