[thelist] PHP_SELF / Contact Form

DAVOUD TOHIDY dtohidy at hotmail.com
Wed Aug 4 10:04:43 CDT 2010

> Date: Mon, 2 Aug 2010 17:44:52 -0400
> To: thelist at lists.evolt.org
> From: kenrbnsn at rbnsn.com
> Subject: Re: [thelist] PHP_SELF / Contact Form

> The <?= tag is shorthand for <?php echo, so you need to replace 
> <?=$name?> with <?php echo $name ?>.
> The reason the short tag is a security risk is that if you move your 
> code to a server that has short tags turned off or your host turns 
> them off, there is a real risk that your code will be shown.
> Ken Robinson

Thanks a lot. I now have another question.

I am using the following for text area :

if(!preg_match('/^([a-zA-Z0-9_\'\s]+)$/', $message)){
$errMsg7 .= "Invalid Entry, Please enter only words";
$valid = false;


if(strlen($message) > 200 ){

// sets max amount of characters in comments area (edit as nesesary) 

$message=substr($message, 0, 200).'...';
$error .="We are sorry for inconvenience. Your message should not exceed 200 characters.<br />";
$valid = false; 

and for the errors to show:

<?php if(isset($errMsg6) && !empty($errMsg6)) {
echo '<p class="message" >' . $errMsg6 . '</p>';

<textarea name="message" id="message" rows="15" cols="50" value="" ><?php echo($message)?></textarea>

But it does not work.  Any idea would be appreciated.



More information about the thelist mailing list