Jump to content

[SOLVED] Form remembering


starvator

Recommended Posts

I have created a members login website here http://ipage.netau.net/index.php.

 

Now, can someone help me create a custom form which remembers what the member inserted ,when they are loged in. 

 

what i mean is http://starvator.890m.com/form.php

<form action="output.php" method="get">
Page Title: <input type="text" name="title" />
<br>
Website #1
Name: <input type="text" name="name1" />
Address: <input type="text" name="link1" />
<br>
Website #2
Name: <input type="text" name="name2" />
Address: <input type="text" name="link2" />
<br>
Website #3
Name: <input type="text" name="name3" />
Address: <input type="text" name="link3" />

<br>
Website #4
Name: <input type="text" name="name4" />
Address: <input type="text" name="link4" />
<br>
Website #5
Name: <input type="text" name="name" />
Address: <input type="text" name="link5" />
<input type="submit" />
</form>
<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript">
var websiteID='starvator.890m.com';
</script>
<script type="text/javascript" src="http://analytics.hosting24.com/do.php"></script>

<noscript>
<a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/s.php?websiteID=starvator.890m.com" alt="web hosting" /></a>
</noscript>
<!-- End Of Code -->

and depending on what they put in, it will show up on http://starvator.890m.com/output.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<link href="pics/homescreen.png" rel="apple-touch-icon" />
<meta content="minimum-scale=1.0, width=device-width, maximum-scale=0.6667, user-scalable=no" name="viewport" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script src="javascript/functions.js" type="text/javascript"></script>
<title></title>
<meta content="iPod,iPhone,Webkit,iWebkit,Website,Create,mobile,Tutorial,free" name="keywords" />
<meta content="Try out all exclusive features iWebKit 4.0 has to offer and discover how far web developement can go. Create the ultimate WebApp!" name="description" />
</head>

<body>

<div id="topbar">
<div id="title">
	</div>
<div id="leftbutton">
	<a href="http://iwebkit.net">Free Homepage Builder</a></div>
</div>
<div id="content">
	<li class="menu"><a href="">
	<span class="name"></span><span class="arrow"></span></a></li>

	<li class="menu"><a href="">
	<span class="name"></span><span class="arrow"></span></a></li>
	<li class="menu"><a href="">
	<span class="name"></span><span class="arrow"></span></a></li>
	<li class="menu"><a href="">
	<span class="name"></span><span class="arrow"></span></a></li>
	<li class="menu"><a href="">
	<span class="name"></span><span class="arrow"></span></a></li>
	<li class="menu"><a href="">

	<span class="name"></span><span class="arrow"></span></a></li>
	<li class="menu"><a href="">
	<span class="name"></span><span class="arrow"></span></a></li>
</ul>

</div>
<div id="footer">
<!-- please keep this line of text for three reasons: to help us, to thank us and just because it is cool-->
<a class="noeffect" href="http://iwebkit.net">Powered by iWebKit</a></div>

</body>

</html>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript">
var websiteID='starvator.890m.com';
</script>
<script type="text/javascript" src="http://analytics.hosting24.com/do.php"></script>
<noscript>
<a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/s.php?websiteID=starvator.890m.com" alt="web hosting" /></a>
</noscript>
<!-- End Of Code -->

 

So, when the users log into their panel, they will be able to customise it from where they left off!

 

I HOPE YOU UNDERSTAND WHAT I NEED!

 

star ;D ;D ;D

Link to comment
Share on other sites

For each textbox, add

 

value="<?php echo $_POST['SELFNAME']; ?>"

 

So like this:

Website #1
Name: <input type="text" name="name1" value="<?php echo $_POST['name1']; ?>" />
Address: <input type="text" name="link1" value="<?php echo $_POST['link1']; ?>" />

 

It should work.. ;)

Link to comment
Share on other sites

For each textbox, add

 

value="<?php echo $_POST['SELFNAME']; ?>"

 

So like this:

Website #1
Name: <input type="text" name="name1" value="<?php echo $_POST['name1']; ?>" />
Address: <input type="text" name="link1" value="<?php echo $_POST['link1']; ?>" />

 

It should work.. ;)

 

I dont understand how it will work, because the output of the page is not in an sort of database... what i need is to find out how to put it in a database... And if i understand your code, it means that the form and output have to both be on the same page...

 

thanks

Link to comment
Share on other sites

The standard way to transfer this data to the next page is with POST.  So change this line:

 

</pre>
<form action="output.php" method="POST"><

 

And on "output.php" change this to:

 


   
   
   

   

      

 

You're going to have to store these URL's in the database somewhere to remember what the user put in.  Make some sort of login system.

 

P.S. - Looks like you were missing the opening

    tag there as well.
Link to comment
Share on other sites

The standard way to transfer this data to the next page is with POST. So change this line:

 

<form action="output.php" method="POST">

 

And on "output.php" change this to:

 

<div id="content">
<ul>
<?php  foreach($_POST AS $url) {  ?>   
  <span class="name"></span><span class="arrow"></span></a></li>
  <li class="menu"><a href="<?php echo $url; ?>"><?php echo $url; ?></a>
<?php } ?>
  </ul>
</div>

 

You're going to have to store these URL's in the database somewhere to remember what the user put in. Make some sort of login system.

 

P.S. - Looks like you were missing the opening <ul> tag there as well.

 

I am very sory, but i am a complete noob at this and do not understand what you said... Instead of the

<form action="output.php" method="get">
Page Title: <input type="text" name="title" />
<br>
Website #1
Name: <input type="text" name="name1" />
Address: <input type="text" name="link1" />

put

 

<form action="output.php" method="get">
Page Title: <div id="content">
<ul>
<?php  foreach($_POST AS $url) {  ?>   
  <span class="name"></span><span class="arrow"></span></a></li>
  <li class="menu"><a href="<?php echo $url; ?>"><?php echo $url; ?></a>
<?php } ?>
  </ul>
</div>
<br>
Website #1
Name: <div id="content">
<ul>
<?php  foreach($_POST AS $url) {  ?>   
  <span class="name"></span><span class="arrow"></span></a></li>
  <li class="menu"><a href="<?php echo $url; ?>"><?php echo $url; ?></a>
<?php } ?>
  </ul>
</div>
Address: <div id="content">
<ul>
<?php  foreach($_POST AS $url) {  ?>   
  <span class="name"></span><span class="arrow"></span></a></li>
  <li class="menu"><a href="<?php echo $url; ?>"><?php echo $url; ?></a>
<?php } ?>
  </ul>
</div>

^^^ I AM SO CONFUSED!

 

ALL OF THESE CODES CONFUSE ME OUT OF MY MIND!

Link to comment
Share on other sites

^^^ I AM SO CONFUSED!

 

I can tell!  :P

 

Change this line:

 

</pre>
<form action="output.php" method="get"><

 

to:

 

</pre>
<form action="output.php" method="POST"><

 

And, in output.php, change this portion of code:

 

      
      

      
      
      
      
      
      
      
      
      

      
      
      
   
   

 

to this:

 


   
   
   

   

 

 

Link to comment
Share on other sites

^^^ I AM SO CONFUSED!

 

I can tell!  :P

 

Change this line:

 

<form action="output.php" method="get">

 

to:

 

<form action="output.php" method="POST">

 

And, in output.php, change this portion of code:

 

<div id="content">
      <li class="menu"><a href="">
      <span class="name"></span><span class="arrow"></span></a></li>

      <li class="menu"><a href="">
      <span class="name"></span><span class="arrow"></span></a></li>
      <li class="menu"><a href="">
      <span class="name"></span><span class="arrow"></span></a></li>
      <li class="menu"><a href="">
      <span class="name"></span><span class="arrow"></span></a></li>
      <li class="menu"><a href="">
      <span class="name"></span><span class="arrow"></span></a></li>
      <li class="menu"><a href="">

      <span class="name"></span><span class="arrow"></span></a></li>
      <li class="menu"><a href="">
      <span class="name"></span><span class="arrow"></span></a></li>
   </ul>
   
</div>

 

to this:

 

<div id="content">
<ul>
<?php  foreach($_POST AS $url) {  ?>   
   <span class="name"></span><span class="arrow"></span></a></li>
   <li class="menu"><a href="<?php echo $url; ?>"><?php echo $url; ?></a>
<?php } ?>
   </ul>
</div>

 

ok, i can do that, but how would i get it into my database? ??? ??? ???

Link to comment
Share on other sites

ok, i can do that, but how would i get it into my database? ??? ??? ???

 

That's going to require you to read some tutorials. 

 

Do you have a DB setup?

Do you know how to create tables and fields?

Do you know what you want your structure to look like?

And I assume you don't know how to INSERT and SELECT data from a DB...?

 

I suggest reading this: PHP & MySQL.

 

Good luck, come back if you have any specific questions, we'll be happy to help.

 

 

Link to comment
Share on other sites

ok, i can do that, but how would i get it into my database? ??? ??? ???

 

That's going to require you to read some tutorials.

 

Do you have a DB setup?

Do you know how to create tables and fields?

Do you know what you want your structure to look like?

And I assume you don't know how to INSERT and SELECT data from a DB...?

 

I suggest reading this: PHP & MySQL.

 

Good luck, come back if you have any specific questions, we'll be happy to help.

 

I TOLD YOU I AM A COMPLETE NOOB

 

I already have a database with a login system, but i copied the codes from a guide...

Link to comment
Share on other sites

PHP & MySQL for dummies is a good place to start too. It will teach you how to connect to a a MySQL database with PHP and some basic SQL to insert and retrieve your data. You will need to use the mysql_connect() function to connect to the database, and mysql_query() to interact with the database. The online phpManual can give you some basics about the functions. Alternately, if the only reason you are storing this information is for a returning user, you could possibly just set cookies to remember this information. Copying scripts without any knowledge of how they work is like downloading a set of plans for a building and then going on the internet and asking "How do I build this?"  We'd love to help, it's just there are books and website tutorials dedicated to this, we can't answer such general questions in a single post.

Link to comment
Share on other sites

PHP & MySQL for dummies is a good place to start too. It will teach you how to connect to a a MySQL database with PHP and some basic SQL to insert and retrieve your data. You will need to use the mysql_connect() function to connect to the database, and mysql_query() to interact with the database. The online phpManual can give you some basics about the functions. Alternately, if the only reason you are storing this information is for a returning user, you could possibly just set cookies to remember this information. Copying scripts without any knowledge of how they work is like downloading a set of plans for a building and then going on the internet and asking "How do I build this?"  We'd love to help, it's just there are books and website tutorials dedicated to this, we can't answer such general questions in a single post.

 

k thx, anyways im bored of this topic and dont feel like building the site afterall...

Link to comment
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.