|
Posted by J.O. Aho on 03/02/06 21:00
talk2raj55@gmail.com wrote:
> Hi
>
> I am doing my project and is database oriented,
> the project is running fine under windows but the same thing doesent
> run under linux(Fedora 4).
> If i try to insert records from the terminal window then the records
> are inserted without any problem,
> but when i try to do in the php form, then a blank entry is inserted in
> the database.
> There are two files a.html & a.php, now the html file calls the php
> one, which actually contains the insert query.Now the values from the
> html are not reflected in the database, instead a blank entry is
> inserted.
> Whereas if a separate query with desired values is written into the php
> file then that query is executed fine.
>
> Please help me out of this problem.
> I need help at the earliest
>
My guess is that the microsoft box uses an outdate version of php which by
default has register_globals turned on
When On you can directly use the variables in the code, but you get a bad
security on the php at the same time
eg:
$query="INSERT INTO table VALUES('$formvalue')";
When Off you increase security of the php script, but this requires you to
transfer the value to a variable
eg:
$formvalue=$_POST['formvalue'];
$query="INSERT INTO table VALUES('$formvalue')";
You can change the register_globals in the php.ini or make your code more secure.
//Aho
Navigation:
[Reply to this message]
|