Reply to Re: Send data form to mysql

Your name:

Reply:


Posted by Rincewind on 07/25/05 16:58

On Sun, 24 Jul 2005 19:24:57 GMT, Luigi Donatello Asero wrote:

> "J.O. Aho" <user@example.net> skrev i meddelandet
> news:3ki7isFuib21U1@individual.net...
>> Luigi Donatello Asero wrote:
>>> "J.O. Aho" <user@example.net> skrev i meddelandet
>>> news:3ki3ofFud4lmU1@individual.net...
>
>> should be:
>> if(array_key_exists('add', $_POST) && ($_POST['add']=="Skicka")) {
>>
>>> {$fornamn = $_POST['fornamn'];
>> should be:
>> $fornamn = $_POST['fornamn'];
>
> Do you mean only a"{" after "=="Skicka")) "?
>
> Well, I still get a error.
>
>
> https://www.scaiecat-spa-gigi.com/sv/form.php
>
>
> <html>
> <body>
> <?PHP
> "array_key_exists{'add', $_POST)" && ($_POST['add']=="Skicka"){
> $fornamn = $_POST['fornamn'];
> $efternamn = $_POST['efternamn'];
> $db = mysql_connect("local host", "user","password") or die('I could not
> connect);
> mysql_select_db("scaiecat_?", $db);
> $query="INSERT INTO Formulär('förnamn','efternamn')
> VALUES('$fornamn','$efternamn')";
> mysql_query($query) or die('Error, insert query failed');
> echo "Följande har sparats till databasen:<br>\n
> Förnamn: $fornamn<br>\n
> Efternamn: $efternamn<br>\n";
> } else {
> ?>
> <form method="post">
> <label for="Fornamn">Förnamn</label>
> <input type="text" name="fornamn" id="Fornamn"><br>
> <label for="Efternamn">Efternamn</label>
> <input type="text" name="efternamn" id="efternamn"><br>
> <input type=submit name="add" VALUE="Skicka">
> </form>
> <?PHP
> }
> ?>
> </body>
> </html>

As others have said you should get an editor with syntax highlighting, that
said I am surprised that nobody seems to have run this thrugh one?

the line:

$db = mysql_connect("local host", "user","password") or die('I could not
connect);

should be:

$db = mysql_connect("local host", "user","password") or die('I could not
connect');

by using syntax highlighting you would pick up these errors real quick,

I've run it through my server and it seems to parse ok, i.e. no error
messages.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация