Fw: [PHP] Re:[PHP]question

2002-09-11 Thread Meltem Demirkus

I think because of my bad english I made you misunderstand..I ment this :
for example  when a person miss an input  to fill on the from  and then
press the submit button I want him to be back to the same form page with a
special message that I entered (something like :you left . place
empty).But I dont want to copy the same form page accoring to the possible
mistakes .. I want to learn if there is an easier way to do this...
thanks to everyone..

meltem
- Original Message -
From: Meltem Demirkus [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 11, 2002 4:40 PM
Subject: [PHP] Re:[PHP]question



 Thanks ...But I know this way about carrying data from one page to
another..
 I want this message to be seen on the page without my doing
anythingand
 I cant do that?..

 - Original Message -
 From: John Wards [EMAIL PROTECTED]
 To: Meltem Demirkus [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, September 11, 2002 4:36 PM
 Subject: Re: [PHP] question


  pass the message as a variable
 
  header:location.php?message=$message
 
 
  - Original Message -
  From: Meltem Demirkus [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, September 11, 2002 2:31 PM
  Subject: [PHP] question
 
 
   Hi,
   I am working on a process which turn to the previous page when the
user
   enter something wrong in the form on a page .But I also want to warn
the
   user with an error message on this page ...I know using heder :
location
  but
   I couldn't  add the message ...
   can anybody help me ? How can I add this message to the page..
   thanks alot
  
   metos
  
  
   --
   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




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




Re: Fw: [PHP] Re:[PHP]question

2002-09-11 Thread Support @ Fourthrealm.com

Meltem,

You're much better off to use JavaScript to perform the form 
validation.  This way, when the user clicks on the Submit button, 
JavaScript can make sure that values are filled in, or that they are within 
range, and can then pop up a message advising them of any errors, and that 
they can't continue until the info is corrected.  This saves the hassle of 
you having to create a system that will send details to/from various pages, 
and the user doesn't have to fill in the entire form all over again, as 
their values stay on the page.

I use this site quite often for javascript code:
http://javascript.internet.com/

Peter


At 04:53 PM 9/11/2002 +0300, you wrote:
I think because of my bad english I made you misunderstand..I ment this :
for example  when a person miss an input  to fill on the from  and then
press the submit button I want him to be back to the same form page with a
special message that I entered (something like :you left . place
empty).But I dont want to copy the same form page accoring to the possible
mistakes .. I want to learn if there is an easier way to do this...
thanks to everyone..

meltem
- Original Message -
From: Meltem Demirkus [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 11, 2002 4:40 PM
Subject: [PHP] Re:[PHP]question


 
  Thanks ...But I know this way about carrying data from one page to
another..
  I want this message to be seen on the page without my doing
anythingand
  I cant do that?..
 
  - Original Message -
  From: John Wards [EMAIL PROTECTED]
  To: Meltem Demirkus [EMAIL PROTECTED];
  [EMAIL PROTECTED]
  Sent: Wednesday, September 11, 2002 4:36 PM
  Subject: Re: [PHP] question
 
 
   pass the message as a variable
  
   header:location.php?message=$message
  
  
   - Original Message -
   From: Meltem Demirkus [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Wednesday, September 11, 2002 2:31 PM
   Subject: [PHP] question
  
  
Hi,
I am working on a process which turn to the previous page when the
user
enter something wrong in the form on a page .But I also want to warn
the
user with an error message on this page ...I know using heder :
location
   but
I couldn't  add the message ...
can anybody help me ? How can I add this message to the page..
thanks alot
   
metos
   
   
--
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
 
 


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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: Fw: [PHP] Re:[PHP]question

2002-09-11 Thread timo stamm

Hi Meltem,


the second one was a better description of your problem.
Attached is the most convenient approach can come up with for 
this problem. It is not optimized, but should be easy to 
understand.


Timo


?php

$submitted = isset($_REQUEST['a']); // submitting data or just 
retrieving page?
if($submitted) $fields_complete = ($_REQUEST['a']  
$_REQUEST['b']  $_REQUEST['c']); // are all fields filled?

if(!$submitted) {
$f_a_def = ;
$f_a_err = ;
$f_b_def = ;
$f_b_err = ;
$f_c_def = ;
$f_c_err = ;
};

if($submitted  !$fields_complete) {
if($_REQUEST['a']) { $f_a_def = $_REQUEST['a']; $f_a_err = ;}
else { $f_a_def = ; $f_a_err = you forgot to fill this field;};
if($_REQUEST['b']) { $f_b_def = $_REQUEST['b']; $f_b_err = ;}
else { $f_b_def = ; $f_b_err = you forgot to fill this field;};
if($_REQUEST['c']) { $f_c_def = $_REQUEST['c']; $f_c_err = ;}
else { $f_c_def = ; $f_c_err = you forgot to fill this field;};
};

if(!$submitted || !$fields_complete) {
echo ('
form name=myform action='.$_SERVER['PHP_SELF'].' method=get
input name=a type=text size=20 value='.$f_a_def.' 
'.$f_a_err.'br
input name=b type=text size=20 value='.$f_b_def.' 
'.$f_b_err.'br
input name=c type=text size=20 value='.$f_c_def.' 
'.$f_c_err.'br
input value=submit type=submit onClick=self.location.href=\'\'
/form
');
};

if($fields_complete) {
echo (all fields filled);
};

?


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