Help With PHP Code and Separating <TD> tags

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Help With PHP Code and Separating <TD> tags
DivotMaker
CZ Newbie
DivotMaker has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 02, 2004
0.00 posts per day
Posts: 21
Points: 976
   
I have the following code that displays "Create New Account" or "Welcome Username" followed by the date. I'd like to have the date on the far right side of the screen in its own <TD> section. I just can't figure out how to separate this out to make it work. Any ideas? Thanks for any help.

."<td nowrap class=\"artsubhead\" align=\"left\">\n";
    if ($username == "Anonymous") {
        echo "<a href=\"user.php\">Create New Account</a>\n";
    } else {
        echo " Welcome $username! | <a href=\"user.php?op=logout\">logout</a> | ";
    }
    echo "<sccript type=\"text/javascript\">\n"
        ."<!--   // Array ofmonth Names\n"
        ."var monthNames = new Array( \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\n"
        ."var now = new Date();\n"
        ."thisYear = now.getYear();\n"
        ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
        ."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear) ;\n"
        ."// -->\n"
        ."</sccript></td>



Back to top Reply with quote
#2   re: Help With PHP Code and Separating <TD> tags
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.48 posts per day
Posts: 3765
Points: 351,412
   
Try this:

echo "<td nowrap class=\"artsubhead\" align=\"left\">\n";
    if ($username == "Anonymous") {
        echo "<a href=\"user.php\">Create New Account</a>\n";
    } else {
        echo " Welcome $username! | <a href=\"user.php?op=logout\">logout</a>\n";
    }
echo "</td>\n<td nowrap class=\"artsubhead\" align=\"right\">\n"
      ."<sccript type=\"text/javascript\">\n"
        ."<!--   // Array ofmonth Names\n"
        ."var monthNames = new Array( \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\n"
        ."var now = new Date();\n"
        ."thisYear = now.getYear();\n"
        ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
        ."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear) ;\n"
        ."// -->\n"
        ."</sccript></td>";



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum