you still need to declare the values as GLOBAL

-----Original Message-----
From: Dr. Shim [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Function Not Accepting Variable Values From a Form


I will try $_POST[] first. I do that under the "value" parameter for each
form element?
<input type="text" name="author" value="<?php $_POST['author'] ?>">
Right?


--------------------------------------------------------------
"Julio Nobrega Trabalhando" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Scope. Try to pass the values as the function reference (inside the ()),
'global' them, or use $_POST[''], from 4.1 and beyond.

  If you don't know what's a 'scope', there's an entry on the manual that
can explain better.

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


"Dr. Shim" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Alas, more problems with forms =)
>
> Well now, here is my problem. I have a form, "method" is set to "post",
and
> action is set to the same page. I also have a hidden field named
> "form_post" and it's value is "1".
>
> Underneath this form is my PHP script.
>
> <?php
>
> if (isset($form_post))
>    {
>     echo "Function \"isset\" called. Values are...<br>\n
>      Title: $title<br>\n
>      Author: $author<br>\n
>      Lead Actors: $actors<br>\n
>      Poster: $poster<br>\n
>      Summ.: $summery<br><br>\n\n
>      Rev.: $review<br><br>\n\n";
>     verify();        // Function call to verify
>    } else {
>     exit;
>    }    // Since form_post is set, it proceeds to verify. Strangley
enough,
> all the values appear in this if block.
>
>
> function verify()
>    {
>
>     echo "Verify called. Values are...<br>\n
>      Title: $title<br>\n
>      Author: $author<br>\n
>      Lead Actors: $actors<br>\n
>      Poster: $poster<br>\n
>      Summ.: $summery<br><br>\n\n
>      Rev.: $review<br><br>\n\n";
>    }
>
> In the function "verify" no values appear, just:
>
> Title:
> Author:
> Lead Actors:
> Poster:
> Summ.:
>
> Rev.:
>
> Although -- as the comment said -- the if block shows all the values just
> fine.
>
>
> What could possibly be wrong? The solution to my last problem was to get
rid
> of any functions. However, that results in highly messy code! There has
got
> to be a way of having values passed to a function.
>
> Thanks for any help/suggestions.
>
>





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to