Page 1 of 1

T-String align?

Posted: Tue Oct 12, 2004 12:14 am
by Trishalyn229
Can someone tell me how to align a t-string?

Posted: Tue Oct 12, 2004 1:24 am
by m3mn0n
Eh?

Posted: Tue Oct 12, 2004 4:31 am
by patrikG
I know G-Strings, but not T-... ;)

Posted: Tue Oct 12, 2004 1:06 pm
by Trishalyn229
twigletmac | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

 @ G-string

Maybe I didn't word it right. This is my code:

Code: Select all

<? } elseif ($action == "join"){

   if (!isset($_POST[name]) || !isset($_POST[email]) || !isset($_POST[country])) {

echo "<H2>Thanks</H2><P>Thank you for joining the Sarah Martin fanlisting. You will be added to the member list as soon as possible.</P>";


    
  } elseif (empty($_POST[name]) || empty($_POST[email]) || empty($_POST[country])) {

echo "<H2>Error</H2><P>Oops, it appears you forgot to enter either your email address, your name or your country. Please press the BACK button in your browser and try again.</P>"; 

  } else {
The problem is, the text in the echos is appearing underneath the header instead of being down where the content should be. I'm trying to find out how to align the text to where I need it to be.

Posted: Tue Oct 12, 2004 2:14 pm
by potsed
if i understand correctly... instead of echo u need to put the strings into a var and then echo the variable where u want it to b...

Code: Select all

<?php

$str =  "<H2>Thanks</H2><P>Thank you for joining the Sarah Martin fanlisting. You will be added to the member list as soon as possible.</P>";

?>

Code: Select all

<?php

echo $str;

?>

Posted: Tue Oct 12, 2004 8:28 pm
by Trishalyn229
Hmmm. Where do I insert the variable? This code is for phpfanbase...the echo is what's displayed after joining. I'm so lost, rotfl.

Posted: Wed Oct 13, 2004 2:58 am
by phpScott
assing your message to a var like

Code: Select all

<?php
    if($succesful)
       $msg="congrats on joining";
    else
        $msg="you forgot something";
?>
then later in your page where you want the message to appear.

Code: Select all

<?php
<html>
<head>
<title>Sarah Martin fan club</title>
</head>
<body>
some other content that you have
<?php if(isset($msg)) echo $msg; ?>
some more content
</body>
</html>
?>
so your message will appear where you want it and only if the variable $msg has been used otherwise nothing will appear.

BTW who is Sarah Martin? As that is my sister name as well.

Posted: Wed Oct 13, 2004 7:31 pm
by Trishalyn229
Sarah's a singer from L.A. ;0) She's about to put out a single, etc.
http://www.sarahmartin.org


Thanks...I'm gonna see if that works. I'm trying to use phpfanbase, and this is my first real crack at php.