Jump to content

Recommended Posts

ok so i have a slight problem which i could use some help with. basically i have a new home page and im wanting to use an image as the submit button for the login. Simple yes? well yes it was, i have it working, However when im on the register page with another form on, the "login" image doesnt work, i believe this is because of the register form, that appears in between the text boxes for the login details and the login image.

 

My question is this, is it possible to "pair" up the image with the login form so when i am on the register page, it still submits those details?

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/
Share on other sites

<html>
<head>
<title>layout_silver</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php include_once('style.css'); ?>
<body  bgcolor="#141414" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (layout_silver.psd) -->
<table id="Table_01" width="951" height="800" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="10">
		<img src="images/layout_silver_01.gif" width="950" height="83" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="83" alt=""></td>
</tr>
<tr>
	<td rowspan="18">
		<img src="images/layout_silver_02.gif" width="27" height="717" alt=""></td>
	<td colspan="5">
		<img src="images/layout_silver_03.gif" width="583" height="20" alt=""></td>
	<td rowspan="18">
		<img src="images/layout_silver_04.gif" width="34" height="717" alt=""></td>
	<td colspan="2">
		<img src="images/layout_silver_05.gif" width="284" height="20" alt=""></td>
	<td rowspan="18">
		<img src="images/layout_silver_06.gif" width="22" height="717" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="20" alt=""></td>
</tr>
<tr>
	<td colspan="5">
		<img src="images/layout_silver_07.gif" width="583" height="19" alt=""></td>
	<td class="login" colspan="2" rowspan="5">
	<form method="post" action="login.php">
	<table style="width: 100%">
<tr>
	<td> </td>
</tr>
<tr>
	<td><input name="Text1" type="text" class="input" /></td>
</tr>
<tr>
	<td> </td>
</tr>
<tr>
	<td><input name="Text2" type="password" class="input"/></td>
</tr>
</table>


		 </td>
	<td>
		<img src="images/spacer.gif" width="1" height="19" alt=""></td>
</tr>
<tr>
	<td rowspan="14">
		<img src="images/layout_silver_09.gif" width="22" height="487" alt=""></td>
	<td rowspan="13" class="main_body">
	<?php
    
      if (!$_GET['step'])
    {
    echo "Homepage";
    }
    
    if ($_GET['step'] == 'register')
    {
    include_once('register.php');
    }
    if ($_GET['step'] == 'register_done')
    {
    include_once('register_done.php');
    }
    
    ?>
		</td>
	<td colspan="3">
		<img src="images/layout_silver_11.gif" width="205" height="4" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="4" alt=""></td>
</tr>
<tr>
	<td rowspan="13">
		<img src="images/layout_silver_12.gif" width="57" height="483" alt=""></td>
	<td>
		<a href="index.php"><img src="images/layout_silver_13.gif" width="142" height="29" alt=""></a></td>
	<td rowspan="13">
		<img src="images/layout_silver_14.gif" width="6" height="483" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="29" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/layout_silver_15.gif" width="142" height="38" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="38" alt=""></td>
</tr>
<tr>
	<td rowspan="2">
		<a href="index.php?step=register"><img src="images/layout_silver_16.gif" width="142" height="29" alt=""></a></td>
	<td>
		<img src="images/spacer.gif" width="1" height="22" alt=""></td>
</tr>
<tr>
	<td rowspan="2"><input type="image" name="login" src="../images/layout_silver_17.gif"></form>
		</td>
	<td rowspan="2">
		<img src="images/layout_silver_18.gif" width="161" height="21" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="7" alt=""></td>
</tr>
<tr>
	<td rowspan="2">
		<img src="images/layout_silver_19.gif" width="142" height="43" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="14" alt=""></td>
</tr>
<tr>
	<td colspan="2" rowspan="10">
		<img src="images/layout_silver_20.gif" width="284" height="564" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="29" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/layout_silver_21.gif" width="142" height="29" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="29" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/layout_silver_22.gif" width="142" height="40" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="40" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/layout_silver_23.gif" width="142" height="29" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="29" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/layout_silver_24.gif" width="142" height="41" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="41" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/layout_silver_25.gif" width="142" height="29" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="29" alt=""></td>
</tr>
<tr>
	<td rowspan="2">
		<img src="images/layout_silver_26.gif" width="142" height="176" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="159" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/layout_silver_27.gif" width="356" height="17" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="17" alt=""></td>
</tr>
<tr>
	<td colspan="5">
		<img src="images/layout_silver_28.gif" width="583" height="20" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="20" alt=""></td>
</tr>
<tr>
	<td colspan="5">
		<img src="images/layout_silver_29.gif" width="583" height="171" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="171" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>

 

hope that helps you :D

 

if you wish to see the layout working go to www.odintest.criminallegends.com

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718762
Share on other sites

It seems like to me that you have named the register button the same as the login button. Basically first I would check that and if its not can you post the register page too. also id did not see where you ended the form. Am I blind?

 

They are not named the same. for login form is closed right after the login button, the register form is closed in the register.php, as for being able to register it would appear the register form is trying to direct me to the location i want the login form to go  :S

<?php
echo "<div><form method=\"post\" action=\"index.php?step=register_done\">	Please fill in all details below, details with a * are optional.
<table style=\"width: 100%\">
<tr>
	<td>Name:</td>
	<td><input name=\"account_name\" type=\"text\" class=\"register_text\"/></td>
</tr>
<tr>
	<td>Email:</td>
	<td><input name=\"email\" type=\"text\" class=\"register_text\" /></td>
</tr>
<tr>
	<td>Password:</td>
	<td><input name=\"password_1\" type=\"password\" class=\"register_text\"  /></td>
</tr>
<tr>
	<td>Password Again:</td>
	<td><input name=\"password_2\" type=\"password\" class=\"register_text\"  /></td>
</tr>
<tr>
	<td>Promo Code*:</td>
	<td><input name=\"promo\" type=\"text\" class=\"register_text\"  /></td>
</tr>
<tr>
	<td><input name=\"Submit2\" type=\"submit\" value=\"submit\" class=\"register_text\"  /></td>
	<td> </td>
</tr>
</table>
</form></div>";

?>

 

that is my register document

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718772
Share on other sites

I don't even see the login button on the first code that you showed me. This is what I am referring to:

 

<form method="post" action="login.php">
	<table style="width: 100%">
<tr>
	<td> </td>
</tr>
<tr>
	<td><input name="Text1" type="text" class="input" /></td>
</tr>
<tr>
	<td> </td>
</tr>
<tr>
	<td><input name="Text2" type="password" class="input"/></td>
</tr>
</table>

 

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718795
Share on other sites

Forget that last post I wasn't looking hard enough. I found the problem. You are calling the login image after you call the other post.

 

<input type="image" name="login" src="../images/layout_silver_17.gif"></form>

 

This needs to be before

 

<?php
    
      if (!$_GET['step'])
    {
    echo "Homepage";
    }
    
    if ($_GET['step'] == 'register')
    {
    include_once('register.php');
    }
    if ($_GET['step'] == 'register_done')
    {
    include_once('register_done.php');
    }
    
    ?>

 

Try that and let me know.

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718808
Share on other sites

Forget that last post I wasn't looking hard enough. I found the problem. You are calling the login image after you call the other post.

 

<input type="image" name="login" src="../images/layout_silver_17.gif"></form>

 

This needs to be before

 

<?php
    
      if (!$_GET['step'])
    {
    echo "Homepage";
    }
    
    if ($_GET['step'] == 'register')
    {
    include_once('register.php');
    }
    if ($_GET['step'] == 'register_done')
    {
    include_once('register_done.php');
    }
    
    ?>

 

Try that and let me know.

 

i cant move it because if i do it will not be in the place i want it to be ><

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718816
Share on other sites

I do not think that there is another option maybe someone else can help but just for testing can you just remove this line:

 

<input type="image" name="login" src="../images/layout_silver_17.gif"></form>

 

and then see if the register button works. note: you can put it back after you test it.

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718818
Share on other sites

I do not think that there is another option maybe someone else can help but just for testing can you just remove this line:

 

<input type="image" name="login" src="../images/layout_silver_17.gif"></form>

 

and then see if the register button works. note: you can put it back after you test it.

 

yeah i can ill do that now and try it

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718821
Share on other sites

sorry about that you would have to end the previous form by adding this:

 

</form>

 

after this:

 

<form method="post" action="login.php">
	<table style="width: 100%">
<tr>
	<td> </td>
</tr>
<tr>
	<td><input name="Text1" type="text" class="input" /></td>
</tr>
<tr>
	<td> </td>
</tr>
<tr>
	<td><input name="Text2" type="password" class="input"/></td>
</tr>

 

so it should look like this:

 

<form method="post" action="login.php">
	<table style="width: 100%">
<tr>
	<td> </td>
</tr>
<tr>
	<td><input name="Text1" type="text" class="input" /></td>
</tr>
<tr>
	<td> </td>
</tr>
<tr>
	<td><input name="Text2" type="password" class="input"/></td>
</tr>
</form>

 

the reason is because you never ended the first form so it is still validating to that one.

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718829
Share on other sites

ok just wanted to make sure that you knew what was going on. If I was you I would recode the page if you want the login to show up so that you have 2 different pages on one page. i know that is kinda confusing but pretty much the page is split into 2. Like this:

 

<table>

<tr>
<td width="400">Make this the register side of the page. there will be alot of code here</td>
<td width="400">then make this the login side of the page. that way you can code stuff for each side of the page</td>
</tr>

</table>

 

Basically this will split the page in half. one side for the register and the other for the login. i can show a better example if you need it. hopefully that is helpful

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718857
Share on other sites

ok just wanted to make sure that you knew what was going on. If I was you I would recode the page if you want the login to show up so that you have 2 different pages on one page. i know that is kinda confusing but pretty much the page is split into 2. Like this:

 

<table>

<tr>
<td width="400">Make this the register side of the page. there will be alot of code here</td>
<td width="400">then make this the login side of the page. that way you can code stuff for each side of the page</td>
</tr>

</table>

 

Basically this will split the page in half. one side for the register and the other for the login. i can show a better example if you need it. hopefully that is helpful

 

looks like thats what ima gonna have to do i guess, was hoping there was a more simple way around it though

Link to comment
https://forums.phpfreaks.com/topic/137536-forms/#findComment-718864
Share on other sites

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.