p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Passing Values


Message #1 by "Sebastian A." <sebi@x...> on Wed, 3 Apr 2002 14:01:43 +0200
Hello,
	Today I was working on an object that will create all of the columns and
tables in my DataBase for my upcoming application. I however, did run into
trouble. I am having problems because I cannot pass the name of the database
from the form to the function that needs it. Everything is on the same page
(sql_create.php), and the functions that gets the data (the form function)
and the function that needs the Database name are both within an object.
Does anyone have any ideas? I can post some code samples if it will help.

Thanks in Advance

Message #2 by "Krister" <krister@m...> on Wed, 3 Apr 2002 16:08:38 +0200
Hi Sebastian

Your form page has an input with name="message"...
and the receiving php-page has a field with $message, and now when they are
both on the same page you need to add:
if ( isset( $message ) ) {
do that;
}

Krister

----- Original Message -----
From: "Sebastian A." <sebi@x...>
To: "beginning php" <beginning_php@p...>
Sent: Wednesday, April 03, 2002 2:01 PM
Subject: [beginning_php] Passing Values


> Hello,
> Today I was working on an object that will create all of the columns and
> tables in my DataBase for my upcoming application. I however, did run into
> trouble. I am having problems because I cannot pass the name of the
database
> from the form to the function that needs it. Everything is on the same
page
> (sql_create.php), and the functions that gets the data (the form function)
> and the function that needs the Database name are both within an object.
> Does anyone have any ideas? I can post some code samples if it will help.
>
> Thanks in Advance
>
>
>

Message #3 by "Nikolai Devereaux" <yomama@u...> on Wed, 3 Apr 2002 09:53:13 -0800
Yes, please post some code...  I don't quite understand what your problem
is.  It sounds like one of three things:

Choosing when to display the form and when to process it (about which
Krister posted a reply)

You're don't have access to the form values inside the processing function
(try importing them into function scope with the "global" keyword)

You are using the global keyword to import the variables into scope, but
they're still not there (use the $_GET or $_POST arrays to access your form
data, you probably have register_globals=off)


Take care,

Nik


  Return to Index