Hi,
I am Bhupen,

I am doing my inventory project in PHP & MYSQL.


I am working in both plate form, i.e. Windows XP and Linux 9

My problem.

The array code which given below is fine working in Windows xampp server where the same code needs to modify in Linux APache and PHP server.

--------------------------------------------------------------------------
This script is working in Windows Xampp
----------------------------------------------

<?php
include("dblib.inc");//Written connectivity with mysql
$message="";

if(empty($form[frmname]) || empty($form[emil]))
$message.="YOu must fill all\n";

if($message=="")
{
newEntry($form[frmname],$form[email]); //function is written in dblib.inc
exit;
}

?>


<form action="<?php $PHP_SELF; >">
User Name:<input type=text name=form[frstname]>
Email:<input type=text name=form[email]>
<input type=submit name=aaa value="SEND!">
</form>


-------------------------------------------------------
But to make workable in my linux OS Apache server, I need to modify like below..
-------------------------------------
<?php
include("dblib.inc");//Written connectivity with mysql
$message="";
$frmname=$_POST[frmname];
$frmemail=$_POST[email];


if(empty($frmname) || empty($frmemail))
$message.="YOu must fill all\n";

if($message=="")
{
newEntry($frmname,$frmemail);
exit;
}

?>


<form action="<?php $PHP_SELF; >">
User Name:<input type=text name=frstname>
Email:<input type=text name=email>
<input type=submit name=aaa value="SEND!">
</form>

-------------------------------

could somebody tell me, why it is happening so?


Thanks
Bhupen
Bangalore

Recommended Answers

All 2 Replies

What is the error that you are getting ? I dont think you can use something like

User Name:<input type=text name=form[frstname]>
Email:<input type=text name=form[email]>

Edit: My mistake. you can specify an array as a name.

I guess, register_globals is turned off in your php settings in linux. Its not recommended to turn it on.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.