set data to table tag

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jaylin
Forum Commoner
Posts: 68
Joined: Fri Nov 18, 2005 4:44 am

set data to table tag

Post by jaylin »

i want to set some words to <Td> tag. is it possible?
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

can we have a lil more detail, if you please :roll:
jaylin
Forum Commoner
Posts: 68
Joined: Fri Nov 18, 2005 4:44 am

Post by jaylin »

i just want to post some message if the login user is invalid.

Code: Select all

<form id=frmlogin method=post action=automobile.php>
                                                            <table cellspacing=0 cellpadding=3 border=0 style="border:1px solid #e0e0e0">
                                                            [color=red]<tr><td ID=err></td></tr>[/color]
                                                            <tr>
                                                                <Td class=title colspan=2 bgcolor=#F1C660>Login (Member Only)</td>
                                                            </tr>
                                                            <Tr>
                                                                <Td class=text  bgcolor=#F6E4B8>Member ID:</td>
                                                                <td bgcolor=#F6E4B8><input type=text id=memberid name=memberid></td>
                                                            </tr>

                                                            <Tr>
                                                                <Td class=text bgcolor=#F6E4B8>Password:</td>
                                                                <td bgcolor=#F6E4B8><input type=password name=password></td>
                                                            </tr>
                                                            <tr>
                                                                <Td bgcolor=#F6E4B8></td>
                                                                <Td bgcolor=#F6E4B8>
                                                                <input type="hidden" name="action" value="submitted" />
                                                                    <input type=submit name=submit value="login" class="button" style="width:50px"></td>
                                                            </table>
                                                            </form>
i want to give the error message on the <Td> tag err

plz help me
n00b Saibot wrote:can we have a lil more detail, if you please :roll:
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

you can do something like this...

Code: Select all

<?php

if(isset($_POST['memberid'])):
$MemID = $_POST['memberid'];
$Pass  = $_POST['password'];

/* ...validate here... */

if($MemID == 'real id' && $Pass == 'real pass')
 //redirect to member home page...
else $Err = "Invalid Username/Password!"

?>

<td class="Err"><?php echo $Err ?></td>
jaylin
Forum Commoner
Posts: 68
Joined: Fri Nov 18, 2005 4:44 am

Post by jaylin »

ya. good idead. but, i just wonder why php can't access the td tag like asp or asp.net?
n00b Saibot wrote:you can do something like this...

Code: Select all

<?php

if(isset($_POST['memberid'])):
$MemID = $_POST['memberid'];
$Pass  = $_POST['password'];

/* ...validate here... */

if($MemID == 'real id' && $Pass == 'real pass')
 //redirect to member home page...
else $Err = "Invalid Username/Password!"

?>

<td class="Err"><?php echo $Err ?></td>
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

ASP or ASP.NET can access the TD tag technically speaking. They can output inside a TD tag but they can't `access` the TD tag runtime... If you want to access TD tag at runtime then you will have to use JS+DOM scripting.
jaylin
Forum Commoner
Posts: 68
Joined: Fri Nov 18, 2005 4:44 am

Post by jaylin »

so, for php, how can i output the text to tg tag.
n00b Saibot wrote:ASP or ASP.NET can access the TD tag technically speaking. They can output inside a TD tag but they can't `access` the TD tag runtime... If you want to access TD tag at runtime then you will have to use JS+DOM scripting.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

jaylin wrote:so, for php, how can i output the text to tg tag.
this is what I've done in my snip I gave you...

Code: Select all

<td class="Err"><?php echo $Err ?></td>
this writes the error in a TD tag... you seem to be confused a bit... cool down and look over it calmly... :wink:
Post Reply