Jump to content

Recommended Posts

The last 3 lines of my "form handler" are:

 

if($sent) {print "Your Email Change was sent successfully"; }

else

{print "We encountered an error sending your mail"; } ?>

 

When the Handler is executed it prints "Your Email Change was sent successfully"

My question is what do I need to add to have the message centered, bolded and with a specific font and/or size?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/267292-php-coding-for-a-handler/
Share on other sites

^ That's interesting style, tibberous.  I've never seen that sort of formatting  :) learn something new every day!

 

Aye, as other say, those are html/css properties.  http://w3schools.com/ has some really awesome tutorials and advice for beginners to these languages, if you want further tips.  HTML is used to create things and display them on a page, CSS styles those things.  If the above is all you need, though, awesome.  If you want to learn more, though, check out the w3 website!

Thanks for the help.

I added the code but am not getting an error when the form is submitted.

 

The last 3 lines now look like this:

 

if($sent) {print echo "<CENTER><B><FONT SIZE=9 FACE=TAHOMA>Your Email Change was sent successfully" }

else

{print "We encountered an error sending your mail"; } ?>

 

 

try this

 

if($sent) {echo "<div align='center'><strong><p style='font-family:tahoma;font-size:9px;' >Your Email Change was sent successfully</p></strong></div>"; }
else
{echo "We encountered an error sending your mail"; } ?>

 

You don't want to use both 'print' and 'echo', as they both do the same thing =] just use one or the other.  this version also involves the html/css version of positioning and font styling

 

EDIT: Put in

if($sent) {echo "<CENTER><B><FONT SIZE=9 FACE=TAHOMA>Your Email Change was sent successfully" }
else
{print "We encountered an error sending your mail"; } ?>

and it worked correctly also.  so whichever you prefer!

*Sigh*

 

CSS code:

.message {
    font-weight: bold;
    text-align: center;
    font-family: tahoma;
    font-size: 9px;
}

 

PHP/HTML code:

if ($sent) {
    echo '<p class="message">Your email change was sent successfully</p>';
}

 

To those who've tried to help: PLEASE try to post valid HTML & CSS, and adhere to the best practise guidelines. We don't need more crappy code on the net after all.

Using a name like form_handler locks that class down to be used with the form handler. The point if css classes is that they are (or should be) re-usable. To make them re-usable while having names that still make sense, they should be named as generically as possible. They should be named by what they *do* not what elements they should attach to. ie; I would be inclined to name said class bold-centered

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.