RE: [PHP] re: some problems with php form

2005-10-20 Thread Ford, Mike
On 19 October 2005 19:24, Jay Blanchard wrote:

 [snip]
 input class=?PHP if ($error_msg) {echo error} else {echo
 normal}? id=firstname name=firstname type=text value=?php
 echo $_POST['firstname'] ? 
 
   how would I fix this error?
 [/snip]
 
 You are missing several semi-colons;
 
 input class=?PHP if ($error_msg) {echo error;} else {echo
 normal;}? id=firstname name=firstname type=text

Hands up to those two, I didn't check carefully enough!!  (Actually, I so 
seldom use the brace style that I probably just forgot PHP doesn't let you omit 
that semicolon ;)

 value=?php echo $_POST['firstname']; ? 

Nope, that one's definitely not necessary -- I actually think it looks ugly, so 
never put one in just before ?

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



Re: [PHP] re: some problems with php form

2005-10-19 Thread Bruce Gilbert
Mike and all,
 guess I still have something wrong as I am getting this error:
 *Parse error*: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in *
/hsphere/local/home/bruceg/inspired-evolution.com/Contact_Form.phphttp://evolution.com/Contact_Form.php
* on line *52*
  line 52 is:
 input class=?PHP
if ($error_msg) {echo error}
else {echo normal}
? id=firstname name=firstname type=text value=?php
echo $_POST['firstname'] ?
  how would I fix this error?

 On 10/18/05, Ford, Mike [EMAIL PROTECTED] wrote:

 On 18 October 2005 15:50, Bruce Gilbert wrote:

  I think so Minuk. Here is the *entire* form code below. Maybe
  someone can
  also point out why the email regex validation code isn't working? TIA
  /begin PHP form
  code*/
 
  ?php
  $form_block=END_FORM

 Here starteth a heredoc ;)

  form method=post action={$_SERVER['PHP_SELF']}
  class=info_request  fieldset class=left
  legend title=About YouAbout You/legend
 
  plabel for=firstnamespan class=red*/span First
  Name: /labelbr
  /
 
  input class=?PHP if ($error_msg){echo input.error;}else{echo 

 Here you try to start a block of PHP code within the heredoc. You can't do
 that.

 Because you didn't show us the heredoc, most of the responses assumed you
 had broken out of PHP completely into HTML, which is why many of the
 solutions produced parse errors.

  input.normal;}? id=firstname name=firstname
  type=text value=?PHP
  echo $_POST['firstname'];?

 Again, you're trying to use PHP code inside a heredoc -- this one's
 solvable, though: as you just want the value of the variable, you can use
 {$_POST['firstname']} (which I notice you do elsewhere!).

 Actually, since you use the heredoc's value once almost immediately after
 assigning it, I think you probably would be better breaking out into PHP for
 most of this, thusly:

 if ($_POST['op']!='ds') {

 ?
 form method=post action=?php echo $_SERVER['PHP_SELF'] ?
 class=info_request 
 fieldset class=left
 legend title=About YouAbout You/legend

 plabel for=firstnamespan class=red*/span First Name:
 /labelbr /

 input class=?PHP
 if ($error_msg) {echo error}
 else {echo normal}
 ? id=firstname name=firstname type=text value=?php
 echo $_POST['firstname'] ?

 ... etc. ...

 ?php
 } else if ($_POST[op] == ds) {

 Hope this helps.

 Cheers!

 Mike

 -
 Mike Ford, Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Headingley Campus, LEEDS, LS6 3QS, United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211


 To view the terms under which this email is distributed, please go to
 http://disclaimer.leedsmet.ac.uk/email.htm




--
::Bruce::


RE: [PHP] re: some problems with php form

2005-10-19 Thread Jay Blanchard
[snip]
input class=?PHP if ($error_msg) {echo error} else {echo normal}?
id=firstname name=firstname type=text value=?php echo
$_POST['firstname'] ?

  how would I fix this error?
[/snip]

You are missing several semi-colons;

input class=?PHP if ($error_msg) {echo error;} else {echo normal;}?
id=firstname name=firstname type=text value=?php echo
$_POST['firstname']; ?

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



Re: [PHP] re: some problems with php form

2005-10-19 Thread Bruce Gilbert
I now have:

plabel for=firstnamespan class=red*/span First Name: /labelbr
/
input class=?PHP if ($error_msg) {echo error;} else {echo normal;}?
id=firstname name=firstname type=text value=?php echo
$_POST[firstname;]; ?

/p

but I still receive the same error:
 ' *Parse error*: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in *
/hsphere/local/home/bruceg/inspired-evolution.com/Contact_Form.phphttp://evolution.com/Contact_Form.php
* on line *54 '*

 On 10/19/05, Jay Blanchard [EMAIL PROTECTED] wrote:

 [snip]
 input class=?PHP if ($error_msg) {echo error} else {echo normal}?
 id=firstname name=firstname type=text value=?php echo
 $_POST['firstname'] ?

 how would I fix this error?
 [/snip]

 You are missing several semi-colons;

 input class=?PHP if ($error_msg) {echo error;} else {echo
 normal;}?
 id=firstname name=firstname type=text value=?php echo
 $_POST['firstname']; ?




--
::Bruce::


RE: [PHP] re: some problems with php form

2005-10-19 Thread Jay Blanchard
[snip]
I now have:

plabel for=firstnamespan class=red*/span First Name: /labelbr
/
input class=?PHP if ($error_msg) {echo error;} else {echo normal;}?

id=firstname name=firstname type=text value=?php echo
$_POST[firstname;]; ?
/p

You added one too many, change $_POST[firstname;]; to $_POST['firstname'];

input class=?PHP if ($error_msg) {echo error;} else {echo normal;}?
id=firstname name=firstname type=text value=?php echo 
$_POST['firstname']; ?

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



Re: [PHP] re: some problems with php form

2005-10-18 Thread Bruce Gilbert
Minuk,
 your revisions gives me an error:
 *Parse error*: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in *
/hsphere/local/home/bruceg/inspired-evolution.com/Contact_Form_test.phphttp://evolution.com/Contact_Form_test.php
* on line *63*
 -Bruce

 On 10/17/05, Minuk Choi [EMAIL PROTECTED] wrote:

 Wait a minute... you meant

 input class=
 ?PHP
 if ($error_msg)
 {
 echo input.error;
 }
 else
 {
 echo input.normal;
 }
 ? id=firstname name=firstname type=text value=?PHP echo
 $_POST['firstname'];?


 ...or am I looking at the wrong thing?

 Bruce Gilbert wrote:

 -- Forwarded message --
 From: Richard Lynch [EMAIL PROTECTED]
 To: Mark Rees [EMAIL PROTECTED]
 Date: Mon, 17 Oct 2005 15:12:50 -0500 (CDT)
 Subject: Re: [PHP] Re: a couple of problems with PHP form
 On Mon, October 17, 2005 5:32 am, Mark Rees wrote:
 
 
 -
 sorry, my editor has not indented again
 -
 also, I want the field to appear hilighted when there is no
 information so I am doing this:
 
 input class=? if($error_msg){ echo error; } ELSE { echo
 normal; } id=firstname name=firstname type=text
 value={$_POST['firstname']}? /
 
 
 I think the quote mark balancing is messed up here...
 
 
 input class=
 this starts a quote for the class=
 There appears to be no ending quote for that...
 
 
 It may simply have been lost in email editing, however...
 
 
 adding the input.error didn't solve the problem dang it.! If there is
 a ending quote missing, I don't see it right off hand.
 
 I know have:
 
 
 input class=? if($error_msg){ echo input.error; } ELSE { echo
 input.normal; } id=firstname name=firstname type=text
 value={$_POST['firstname']}? /
 
 in the css:
 
 input.error {
  border: 2px inset red;
  margin:0;
  font-family: arial, helvetica, sans-serif;
  color: #036;
  width: 15em;
  padding-left: .25em;
  font-weight: bold;
  background: #eee;
 }
 
 
 




--
::Bruce::


Re: [PHP] re: some problems with php form

2005-10-18 Thread Minuk Choi

Can you post your Contact_Form_test.php?

input class=?PHP
if ($error_msg)
{
echo input.error;
}
else
{
echo input.normal;
}
? id=firstname name=firstname type=text value=?PHP echo
$_POST['firstname'];?

should parse into HTML by PHP.  This block, I am assuming is placed in a HTML tag 
and not in a ?PHP block, correct?



Bruce Gilbert wrote:


Minuk,
your revisions gives me an error:
*Parse error*: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in *
/hsphere/local/home/bruceg/inspired-evolution.com/Contact_Form_test.phphttp://evolution.com/Contact_Form_test.php
* on line *63*
-Bruce

On 10/17/05, Minuk Choi [EMAIL PROTECTED] wrote:
 


Wait a minute... you meant

input class=
?PHP
if ($error_msg)
{
echo input.error;
}
else
{
echo input.normal;
}
? id=firstname name=firstname type=text value=?PHP echo
$_POST['firstname'];?


...or am I looking at the wrong thing?

Bruce Gilbert wrote:

   


-- Forwarded message --
From: Richard Lynch [EMAIL PROTECTED]
To: Mark Rees [EMAIL PROTECTED]
Date: Mon, 17 Oct 2005 15:12:50 -0500 (CDT)
Subject: Re: [PHP] Re: a couple of problems with PHP form
On Mon, October 17, 2005 5:32 am, Mark Rees wrote:


 


-
sorry, my editor has not indented again
-
also, I want the field to appear hilighted when there is no
information so I am doing this:

input class=? if($error_msg){ echo error; } ELSE { echo
normal; } id=firstname name=firstname type=text
value={$_POST['firstname']}? /


   


I think the quote mark balancing is messed up here...


 


input class=
this starts a quote for the class=
There appears to be no ending quote for that...


   


It may simply have been lost in email editing, however...


adding the input.error didn't solve the problem dang it.! If there is
a ending quote missing, I don't see it right off hand.

I know have:


input class=? if($error_msg){ echo input.error; } ELSE { echo
input.normal; } id=firstname name=firstname type=text
value={$_POST['firstname']}? /

in the css:

input.error {
border: 2px inset red;
margin:0;
font-family: arial, helvetica, sans-serif;
color: #036;
width: 15em;
padding-left: .25em;
font-weight: bold;
background: #eee;
}



 





--
::Bruce::

 



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



Re: [PHP] re: some problems with php form

2005-10-18 Thread Bruce Gilbert
I think so Minuk. Here is the *entire* form code below. Maybe someone can
also point out why the email regex validation code isn't working?
 TIA
 /begin PHP form
code*/

?php
$form_block=END_FORM
form method=post action={$_SERVER['PHP_SELF']} class=info_request 
fieldset class=left
legend title=About YouAbout You/legend

plabel for=firstnamespan class=red*/span First Name: /labelbr
/

input class=?PHP if ($error_msg){echo input.error;}else{echo 
input.normal;}? id=firstname name=firstname type=text value=?PHP
echo $_POST['firstname'];?

plabel for=lastnamespan class=red*/span Last Name:/labelbr /

input id=lastname name=lastname type=text
value={$_POST['lastname']} //p

plabel for=companyspan class=red*/span Company: /labelbr /

input id=company name=company type=text value={$_POST['company']}
//p

plabel for=phonespan class=red*/span Phone: /labelbr /

input id=phone name=phone type=text value={$_POST['phone']} //p

plabel for=emailspan class=red*/span e-mail: /labelbr /

input id=email name=email type=text value={$_POST['email']} //p

plabel for=email2span class=red*/span re-enter e-mail:
/labelbr /

input id=email2 name=email2 type=text value={$_POST['email2']}
//p
/fieldset
fieldset
legend title=More Info.More Info./legend
plabel for=URLspan class=red*/span
URL:/labelbrhttp://mail.google.com/mail//labelbr/

input id=URL type=text name=URL value={$_POST['URL']}/ /p

plabel for=Contact_Preferencespan class=red*/span Best way to
reach:/labelbr /

select name=Contact_Preference id=Contact_Preference
option value=emailemail/option
option value=phonephone/option
option value=snail_mailsnail mail/option

/select
/p

plabel for=Contact_Timespan class=red*/span Best time to
contact:/labelbr /

select name=Contact_Time id=Contact_Time

option value=morningmorning/option
option value=eveningevening/option
option value=anytimeanytime/option

/select/p

input type=hidden name=op value=ds /

textarea name=message id=message rows= cols= Send us a detailed
message specifying what you wish to accomplish with your web site.
/textarea
input class=submit src=/images/submit.gif alt=Submit type=image
name=submit /

/fieldset
/form
/div
pspan class=red*/span indicates a required field (all fields are
required)./p
END_FORM;
if ($_POST['op']!='ds') {
echo $form_block;
} else if ($_POST[op] == ds) {

//Function saves time and space by eliminating unneccesary code
function check($fieldname)
{
global $err_msg;
if($_POST[$fieldname] == )
{
if ( !isset($err_msg)) { $err_msg = span class='red'You haven't entered
your .$fieldname.!/spanbr /; }
elseif ( isset($err_msg)) { $err_msg=span class='red'You haven't entered
your .$fieldname.!/spanbr /; }
}
return $err_msg;
}

if(!eregi(^(.+)@(.+)\\.(.+)$,$_POST['email']))
{
$error_msg .= BR /Your email appears to be invalid.;
$ok = false;
}

 //
///Function execution/
//

check('firstname');
check('lastname');
check('company');
check('phone');
check('email');
check('email2');
check('URL');
check('Contact_Preference');
check('Contact_Time');
check('message');

//Validating Email Address
if ($_POST['email'] != $_POST['email2']) { $email_err = \nspan
class='red'e-mail address fields do not match!/span; }

if (isset($err_msg) || isset($email_err)) { echo
$err_msg.$email_err.\n\n.$form_block; }
else {
//it's ok to send, so build the mail
$msg = E-mail sent from
www.inspired-evolution.com\nhttp://www.inspired-evolution.com/n
;
$msg .=Sender's first name: {$_POST['firstname']}\n;
$msg .=Sender's last name: {$_POST['lastname']}\n;
$msg .=Company name: {$_POST['company']}\n;
$msg .=Senders Phone number: {$_POST['phone']}\n;
$msg .=Senders email address: {$_POST['email']}\n;
$msg .=Senders email address (re-typed): {$_POST['email2']}\n;
$msg .=The website is : {$_POST['URL']}\n;
$msg .=I prefer to be contacted via: {$_POST['Contact_Preference']}\n;
$msg .=The Best time to contact is: {$_POST['Contact_Time']}\n;
$msg .=Message: {$_POST['message']}\n\n;
$to =[EMAIL PROTECTED];
$subject =There has been a disturbance in the force;
$mailheaders =From: Inspired-Evolution.com
http://www.inspired-evolution.com\n http://www.inspired-evolution.com/n
;
$mailheaders .=Reply-To: {$_POST['email']}\n;
//send the mail
mail ($to, $subject, $msg, $mailheaders);
//display information to user
echo pHola, strong$firstname/strong!.br /br /
We have received your request for a web site review , and will respond
shortly.br /
Thanks for visiting inspired-evolution.com
http://inspired-evolution.comand have a wonderful day!br /br /
Regards,br /br /
strongInspired Evolution/strong/p;
}

}
?
/end PHP form
code*/


 On 10/18/05, Minuk Choi [EMAIL PROTECTED] wrote:

 Can you post your Contact_Form_test.php?

 input class=?PHP
 if ($error_msg)
 {
 echo input.error;
 }
 else
 {
 echo input.normal;
 }
 ? id=firstname name=firstname type=text value=?PHP echo
 

Re: [PHP] re: some problems with php form

2005-10-18 Thread Minuk Choi

Seems like you're using some sort of a template or something.

I am not familiar with this type, so I'm afraid I can't be of much 
help... but if i had to guess, it seems that you have to use {} instead 
of ?PHP and ?  So try this :


replace from the ?PHP line down to the input.error/input.normal line 
with this


?php
/* 
* Do all the logic BEFORE the form layout

*/
$class = input.normal;

if ($error_msg)
$class = input.error;

$form_block=END_FORM
form method=post action={$_SERVER['PHP_SELF']} class=info_request 
fieldset class=left
legend title=About YouAbout You/legend

plabel for=firstnamespan class=red*/span First Name: /labelbr
/

input class={$class?} id=firstname name=firstname type=text 
value={$_POST['firstname']}

Regarding the regex,

check out this page http://www.sitepoint.com/article/regular-expressions-php

the gist of it is
|
eregi('[EMAIL PROTECTED],5}$', $email)|


Good Luck

Bruce Gilbert wrote:


I think so Minuk. Here is the *entire* form code below. Maybe someone can
also point out why the email regex validation code isn't working?
TIA
/begin PHP form
code*/

?php
$form_block=END_FORM
form method=post action={$_SERVER['PHP_SELF']} class=info_request 
fieldset class=left
legend title=About YouAbout You/legend

plabel for=firstnamespan class=red*/span First Name: /labelbr
/

input class=?PHP if ($error_msg){echo input.error;}else{echo 
input.normal;}? id=firstname name=firstname type=text value=?PHP
echo $_POST['firstname'];?

plabel for=lastnamespan class=red*/span Last Name:/labelbr /

input id=lastname name=lastname type=text
value={$_POST['lastname']} //p

plabel for=companyspan class=red*/span Company: /labelbr /

input id=company name=company type=text value={$_POST['company']}
//p

plabel for=phonespan class=red*/span Phone: /labelbr /

input id=phone name=phone type=text value={$_POST['phone']} //p

plabel for=emailspan class=red*/span e-mail: /labelbr /

input id=email name=email type=text value={$_POST['email']} //p

plabel for=email2span class=red*/span re-enter e-mail:
/labelbr /

input id=email2 name=email2 type=text value={$_POST['email2']}
//p
/fieldset
fieldset
legend title=More Info.More Info./legend
plabel for=URLspan class=red*/span
URL:/labelbrhttp://mail.google.com/mail//labelbr/

input id=URL type=text name=URL value={$_POST['URL']}/ /p

plabel for=Contact_Preferencespan class=red*/span Best way to
reach:/labelbr /

select name=Contact_Preference id=Contact_Preference
option value=emailemail/option
option value=phonephone/option
option value=snail_mailsnail mail/option

/select
/p

plabel for=Contact_Timespan class=red*/span Best time to
contact:/labelbr /

select name=Contact_Time id=Contact_Time

option value=morningmorning/option
option value=eveningevening/option
option value=anytimeanytime/option

/select/p

input type=hidden name=op value=ds /

textarea name=message id=message rows= cols= Send us a detailed
message specifying what you wish to accomplish with your web site.
/textarea
input class=submit src=/images/submit.gif alt=Submit type=image
name=submit /

/fieldset
/form
/div
pspan class=red*/span indicates a required field (all fields are
required)./p
END_FORM;
if ($_POST['op']!='ds') {
echo $form_block;
} else if ($_POST[op] == ds) {

//Function saves time and space by eliminating unneccesary code
function check($fieldname)
{
global $err_msg;
if($_POST[$fieldname] == )
{
if ( !isset($err_msg)) { $err_msg = span class='red'You haven't entered
your .$fieldname.!/spanbr /; }
elseif ( isset($err_msg)) { $err_msg=span class='red'You haven't entered
your .$fieldname.!/spanbr /; }
}
return $err_msg;
}

if(!eregi(^(.+)@(.+)\\.(.+)$,$_POST['email']))
{
$error_msg .= BR /Your email appears to be invalid.;
$ok = false;
}

//
///Function execution/
//

check('firstname');
check('lastname');
check('company');
check('phone');
check('email');
check('email2');
check('URL');
check('Contact_Preference');
check('Contact_Time');
check('message');

//Validating Email Address
if ($_POST['email'] != $_POST['email2']) { $email_err = \nspan
class='red'e-mail address fields do not match!/span; }

if (isset($err_msg) || isset($email_err)) { echo
$err_msg.$email_err.\n\n.$form_block; }
else {
//it's ok to send, so build the mail
$msg = E-mail sent from
www.inspired-evolution.com\nhttp://www.inspired-evolution.com/n
;
$msg .=Sender's first name: {$_POST['firstname']}\n;
$msg .=Sender's last name: {$_POST['lastname']}\n;
$msg .=Company name: {$_POST['company']}\n;
$msg .=Senders Phone number: {$_POST['phone']}\n;
$msg .=Senders email address: {$_POST['email']}\n;
$msg .=Senders email address (re-typed): {$_POST['email2']}\n;
$msg .=The website is : {$_POST['URL']}\n;
$msg .=I prefer to be contacted via: {$_POST['Contact_Preference']}\n;
$msg .=The Best time to contact is: {$_POST['Contact_Time']}\n;
$msg .=Message: {$_POST['message']}\n\n;
$to =[EMAIL 

RE: [PHP] re: some problems with php form

2005-10-18 Thread Ford, Mike
On 18 October 2005 15:50, Bruce Gilbert wrote:

 I think so Minuk. Here is the *entire* form code below. Maybe
 someone can
 also point out why the email regex validation code isn't working?  TIA
  /begin PHP form
 code*/
 
 ?php
 $form_block=END_FORM

Here starteth a heredoc ;)

 form method=post action={$_SERVER['PHP_SELF']}
 class=info_request  fieldset class=left
 legend title=About YouAbout You/legend
 
 plabel for=firstnamespan class=red*/span First
 Name: /labelbr
 /
 
 input class=?PHP if ($error_msg){echo input.error;}else{echo 

Here you try to start a block of PHP code within the heredoc.  You can't do 
that.

Because you didn't show us the heredoc, most of the responses assumed you had 
broken out of PHP completely into HTML, which is why many of the solutions 
produced parse errors.

 input.normal;}? id=firstname name=firstname
 type=text value=?PHP
 echo $_POST['firstname'];?

Again, you're trying to use PHP code inside a heredoc -- this one's solvable, 
though: as you just want the value of the variable, you can use 
{$_POST['firstname']} (which I notice you do elsewhere!).

Actually, since you use the heredoc's value once almost immediately after 
assigning it, I think you probably would be better breaking out into PHP for 
most of this, thusly:

if ($_POST['op']!='ds') {

?
form method=post action=?php echo $_SERVER['PHP_SELF'] ? 
class=info_request 
fieldset class=left
legend title=About YouAbout You/legend

plabel for=firstnamespan class=red*/span First Name: /labelbr /

input class=?PHP
if ($error_msg) {echo error}
else {echo normal}
  ? id=firstname name=firstname type=text value=?php
echo $_POST['firstname'] ?

   ... etc. ...

?php
} else if ($_POST[op] == ds) {

Hope this helps.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



Re: [PHP] re: some problems with php form

2005-10-17 Thread Minuk Choi

Wait a minute... you meant

input class=
	?PHP 
		if ($error_msg)

{
			echo input.error; 
		} 
		else

{
			echo input.normal; 
		}

? id=firstname name=firstname type=text value=?PHP echo 
$_POST['firstname'];?


...or am I looking at the wrong thing?

Bruce Gilbert wrote:


-- Forwarded message --
From: Richard Lynch [EMAIL PROTECTED]
To: Mark Rees [EMAIL PROTECTED]
Date: Mon, 17 Oct 2005 15:12:50 -0500 (CDT)
Subject: Re: [PHP] Re: a couple of problems with PHP form
On Mon, October 17, 2005 5:32 am, Mark Rees wrote:
 


-
sorry, my editor has not indented again
-
also, I want the field to appear hilighted when there is no
information so I am doing this:

input class=? if($error_msg){ echo error; } ELSE { echo
normal; } id=firstname name=firstname type=text
value={$_POST['firstname']}? /
   


I think the quote mark balancing is messed up here...
 


input class=
this starts a quote for the class=
There appears to be no ending quote for that...
   


It may simply have been lost in email editing, however...


adding the input.error didn't solve the problem dang it.! If there is
a ending quote missing, I don't see it right off hand.

I know have:


input class=? if($error_msg){ echo input.error; } ELSE { echo
input.normal; } id=firstname name=firstname type=text
value={$_POST['firstname']}? /

in the css:

input.error {
border: 2px inset red;
margin:0;
font-family: arial, helvetica, sans-serif;
color: #036;
width: 15em;
padding-left: .25em;
font-weight: bold;
background: #eee;
}

 



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



Re: [PHP] re: some problems with php form

2005-10-17 Thread Chris

Bruce Gilbert wrote:


-- Forwarded message --
From: Richard Lynch [EMAIL PROTECTED]
To: Mark Rees [EMAIL PROTECTED]
Date: Mon, 17 Oct 2005 15:12:50 -0500 (CDT)
Subject: Re: [PHP] Re: a couple of problems with PHP form
On Mon, October 17, 2005 5:32 am, Mark Rees wrote:
 


-
sorry, my editor has not indented again
-
also, I want the field to appear hilighted when there is no
information so I am doing this:

input class=? if($error_msg){ echo error; } ELSE { echo
normal; } id=firstname name=firstname type=text
value={$_POST['firstname']}? /
   


I think the quote mark balancing is messed up here...
 


input class=
this starts a quote for the class=
There appears to be no ending quote for that...
   


It may simply have been lost in email editing, however...


adding the input.error didn't solve the problem dang it.! If there is
a ending quote missing, I don't see it right off hand.

I know have:


input class=? if($error_msg){ echo input.error; } ELSE { echo
input.normal; } id=firstname name=firstname type=text
value={$_POST['firstname']}? /

 

Shouldn't you jsut be echoing error or normal . A period isn't 
allowed in a class dafinition, and the css will work for all elements of 
type input with a class of error. Also you don't seem to be closing the 
PHP tag at the right place


This is how I would do what it looks like you're trying to do.

input class=?php echo !empty($error_msg)?'error':'normal'? id=firstname name=firstname 
type=text value=?php echo htmlspecialchars($_POST['firstname'])? /


Chris


in the css:

input.error {
border: 2px inset red;
margin:0;
font-family: arial, helvetica, sans-serif;
color: #036;
width: 15em;
padding-left: .25em;
font-weight: bold;
background: #eee;
}

 



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