Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

where are my variables ? (may be a simple problem :)

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

where are my variables ? (may be a simple problem :)

Postby rage0208 » Sat Feb 22, 2003 6:48 am

Hi !

I have a problem using a form in an html document :

<FORM name="f" action="cgi-bin/ajout.php" method="POST" enctype="multipart/form-data">
<input maxlength=30 size=20 name="nom">
<input type=submit value="Envoyer !" name="btnI">
<input maxlength=30 size=20 name="titre">
</FORM>


and here is the ajout.php :

$host="xxxx";
$login="xxxx";
$base="xxxx";
$passe="xxxx";
@mysql_connect("$host","$login","$passe");
$select_base=mysql_select_db("$base");
if (!$select_base)
echo "try again";
else {
print "$titre $nom $texte";
}
?>


The problem is that ajout.php have empty variables : $titre, $nom and $texte do not have the value that is given in the <form>. Their valies are "".
It is on my foxserv server, and it works on the free.fr server.

So if you can guess what I have to change either in my code, either in the server config file, it would be really helpful to me.

Thanks
rage0208
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Feb 22, 2003 6:38 am
Location: Paris

i think i have found

Postby rage0208 » Sat Feb 22, 2003 7:03 am

by reading some other threads, i foud that :

$nom=$_POST[nom];
$titre=$_POST[titre];
$texte=$_POST[texte];


and it works.
So the way of getting the variables is different with my sever. Is it a difference between the php4 and php3 ?
rage0208
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Feb 22, 2003 6:38 am
Location: Paris

Postby Redcircle » Sun Feb 23, 2003 12:06 pm

User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.