Re: im so stupid
| From: | chris | Date: | Tue, 12 Feb 2002 09:15:42 +0000 |
| Subject: | Re: im so stupid | ||
| References: | 1 2 3 4 5 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-12014@lists.php.net to get a copy of this message | ||
Well. this is what shows up...
bruker:
passord:
PHP Warning: Undefined variable: bruker in
c:\inetpub\wwwroot\testsite\registrer.php on line 2 PHP Warning: Undefined
variable: passord in c:\inetpub\wwwroot\testsite\registrer.php on line 3
and this is all i have on the page :
<?php
echo 'Fornavn: ' . $fornavn . '<br>';
echo 'Etternavn: ' . $etternavn . '<br>';
?>
So do I have a problem with my PHP configuration???
LOL this thing is gonna drive me crazy before i get it right....
-Chris
"George Pitcher" <fmdev@yahoo.co.uk> wrote in message
news:20020212085517.50329.qmail@pb1.pair.com...
> Chris,
>
> If you are concerned that your variables aren't being read and then
> processed, chek them first and forget the db side for now.
>
> On your response page, just have the following:
>
> <?php
> echo 'Fornavn: ' . $fornavn . '<br>';
> echo 'Etternavn: ' . $etternavn . '<br>';
> ?>
>
> If you get your variable data being displayed as you entered it then that
> part's fine and you can go on and look at db problems. If not then you
have
> a problem with your php configuration.
>
> George
> "Chris" <tometerlaks@hotmail.com> wrote in message
> news:20020212083918.44289.qmail@pb1.pair.com...
> > Well i tried this and it only tells me that my values are undefined
> > variables....
> > It seems like the register.php is not receiving the info from
> > register.html???
> > i have checked 1000 times to make sure that the register.html has the
> right
> > action and there are no "typo's" whats going on... ???
> >
> > "Todd Williamsen" <todd@williamsen.net> wrote in message
> > news:20020211165225.23849.qmail@pb1.pair.com...
> > > Afan...
> > >
> > > First off, to make things easier and since you are calling
register.php
> in
> > > your form...
> > >
> > > Just make a plain HTML page like this and name it whatever the hell
you
> > want
> > >
> > > <html>
> > > <head></head>
> > > <body><form method="post" action="registrer.php">
> > > Fornavn: <input type="text" name="fornavn"><br>
> > > Etternavn: <input type="text" name="etternavn"><br>
> > > <input type="Submit" name="submit"
> > > value="Registrer"><br> </form>
> > > </body>
> > > </html>
> > >
> > > Then make your registrer.php page:
> > >
> > >
> > > $db = MSSQL_CONNECT($hostname,$username,$password);
> > > mssql_select_db($dbname);
> > > $sql = "insert into studenter(fornavn, etternavn) values
> > > ('$fornavn','$etternavn')";
> > > $result = mssql_query($sql, $db);
> > >
> > > <html>
> > > <head>
> > > <title>Success!</title>
> > > <body>
> > > <h2>You have successfully entered the following information <? echo
> > > "$fornavn<br> $etternavn"; ?></h2>
> > > </body>
> > > </html>
> > >
> > >
> > >
> > > "Afan Pasalic" <afan@sprout.net> wrote in message
> > > news:005601c1b310$fa19ad80$311f49d1@VAIO...
> > > Try this:
> > >
> > > $db = MSSQL_CONNECT($hostname,$username,$password);
> > > mssql_select_db($dbname);
> > > $sql = "insert into studenter(fornavn, etternavn) values
> > > ('$fornavn','$etternavn')";
> > > $result = mssql_query($sql, $db);
> > >
> > >
> > > Afan
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: chris
> > > To: php-windows@lists.php.net
> > > Sent: Monday, February 11, 2002 6:10 AM
> > > Subject: [PHP-WIN] im so stupid
> > >
> > >
> > > I have made a script and for some reason i dont understand it doesnt
> do
> > > what
> > > its supposed to. maybe you can tell me whats wrong. its a form
where
> im
> >
> > > supposed to insert a new record in a mssql table. but when i hit
> submit
> > it
> > > just refreshes blank.
> > >
> > > <html>
> > > <head></head>
> > > <body><form method="post" action="registrer.php">
> > > Fornavn: <input type="text" name="fornavn"><br>
> > > Etternavn: <input type="text" name="etternavn"><br>
> > > <input type="Submit" name="submit"
> > > value="Registrer"><br> </form>
> > > <?
> > > IF (isset($submit))
> > > {
> > > $hostname = "dbname";
> > > $username = "chris";
> > > $password = "*****";
> > > $dbname = "chris";
> > > MSSQL_CONNECT($hostname,$username,$password);
> > > mssql_select_db($dbname);
> > > $sql = "insert into studenter(fornavn, etternavn) values
> > > ('$fornavn','$etternavn')";
> > > $result = mssql_query($sql);
> > > $studentnummer = mssql_insert_id();
> > > Print("Studenten er lagt inn!");
> > > }
> > > ?>
> > > </body>
> > > </html>
> > >
> > > hope you can help.
> > >
> > > -Chris
> > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>