Re: [BEGINNER] Strange problem when passing data
| From: | Monte Ohrt | Date: | Sat, 28 Apr 2001 17:04:01 +0000 |
| Subject: | Re: [BEGINNER] Strange problem when passing data | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-637@lists.php.net to get a copy of this message | ||
Luc Saint-Elie wrote:
>
> Hello,
>
> Apparently my problem is related to file passing data to files passing data
> to file etc...
>
> I simplified things to the extreme , suppressed my authentification Class,
> just let the called function in the include file and I still have problems :
>
> 1 ) The Web browser calls index.php
> 2) index.php displays index.tpl
> 3) inside index.tpl there is a links listing with a {if}statement .
> 4) I click on a link and then index.tpl includes register.tpl
> 5) register.tpl is a form that calls register.php
> 6) I controlled the out put of the form, its apparently ok
> 7) register.php contains the following :
>
> ===================================
> <?php
>
> include('fct2_backend.php');
>
> $reponse = register($username, $password, $password2, $name, $email,
> $fmail, $age, $sex, $description, $url);
>
> $template->assign($reponse,$reponse);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here's that line I'm wondering about again. Shouldn't that read:
$template->assign("response",$reponse);
> $template->assign("op",$op);
>
> if ($reponse == 2) {
> $template->display('index.tpl?op=registerok');
> } else {
>
> $template->display('index.tpl?op=registererror&raison=reponse');
> }
> ?>
> ==============================================
>
> 8) the included file (fct2_backend.php) contains only the following (before
> there was a complete class that I cut to see where things get screwed) :
>
> =================================================
> <?php
>
> function register ($username,$password,$password2,$name,$email,$fmail,
> $age, $sex,$description,$url) {
>
> if (!$username || !$password || !$password2 || !$name || !$email || !$fmail
> || !$age || !$sex || !$description, || !$url) {
> return 'problem';
> } else {
> return 'ok';
> }
>
> ?>
> ====================================================
>
> The result is
>
> Parse error: parse error in fct2_backend.php on line 5
>
> Fatal error: Call to undefined function: register() in register.php on line 11
>
> line 5 of fct2_backend.php is the if statement
>
> Apparently my data that are supposed to pass from register.tpl to
> register.php then to fct_2_backend.php are lost somewhere
>
> At 10:52 28/04/01 -0500, Monte Ohrt wrote:
> > > $template->assign($reponse,$reponse);
> >
> >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> >Is that part of your problem?
>
> Suppressing this line doesn't change the result, I assigned this value
> because $reponse is the answer (in French reponse means answer ) to the
> registration process, and in the case it fails the user is supposed to be
> sent back a file explaining what failed
>
> Luc
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/