Page 1 of 1

set data to table tag

Posted: Sun Nov 27, 2005 11:20 pm
by jaylin
i want to set some words to <Td> tag. is it possible?

Posted: Mon Nov 28, 2005 3:41 am
by n00b Saibot
can we have a lil more detail, if you please :roll:

Posted: Mon Nov 28, 2005 4:38 am
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:

Posted: Mon Nov 28, 2005 4:45 am
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>

Posted: Mon Nov 28, 2005 4:48 am
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>

Posted: Mon Nov 28, 2005 5:40 am
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.

Posted: Mon Nov 28, 2005 5:46 am
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.

Posted: Mon Nov 28, 2005 5:49 am
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: