Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mysql/php post help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
stickyfingers
n00b
n00b


Joined: 15 Jun 2003
Posts: 5

PostPosted: Mon Sep 15, 2003 6:15 am    Post subject: mysql/php post help Reply with quote

I've just started to try to learn php and mysql.

From a browser I'm able to connect to the db, I can also create a form that searches records on the db.

What i've never been able to figure out is how to post data to the database. I can do it manually or w/ php if I specify the value, but if I use a variable and use text boxes to submit it never works.

I get no errors (none from the command line either, the data just won't post, I've read a few hundred tutorials so the code is prob good, just something on my end.

Could this maybe a security feature on mysql? something like the local infile?

any leads or suggestions would be appreciated
Back to top
View user's profile Send private message
Maddog39
n00b
n00b


Joined: 12 Sep 2003
Posts: 16
Location: Melbourne, AU

PostPosted: Mon Sep 15, 2003 7:04 am    Post subject: Reply with quote

are you accessing your vars as globals?
e.g.
Code:
$formvar

by default thats turned off
either set
Code:
register_globals = On
in /etc/php/subdir/php.ini
or use
Code:
$HTTP_POST_VARS["formvar"]
Back to top
View user's profile Send private message
stickyfingers
n00b
n00b


Joined: 15 Jun 2003
Posts: 5

PostPosted: Mon Sep 15, 2003 7:33 am    Post subject: Reply with quote

register_globals php.ini

Thanks thats it.
Back to top
View user's profile Send private message
Reqwn
n00b
n00b


Joined: 29 Nov 2003
Posts: 6
Location: Vancouver, BC

PostPosted: Sun Nov 30, 2003 8:18 pm    Post subject: Reply with quote

Thanks! Couldnt remember what variable to change to fix that problem.
Back to top
View user's profile Send private message
motosauro
Tux's lil' helper
Tux's lil' helper


Joined: 23 Nov 2005
Posts: 83
Location: Verona, Italy

PostPosted: Mon Oct 02, 2006 10:18 am    Post subject: Reply with quote

stickyfingers wrote:
register_globals php.ini

Thanks thats it.

A better way imho would be to use arrays like $_POST['variable_name']
There are a good numbers, they are integrated in php and in my experience make the code so much easier to debug and mantain :)
_________________
Per aspera ad astra
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum