Jump to content

Recommended Posts

do this first, get the hidden field working, it shouldnt be too hard.

then get the process form (sendinfo2.php) to pull out the users name, and then  open the text file and read it line by line, each time checking if the line has the username in it.

 

next part will be taking that line from text file, explode the data into an array (note that the delimiter is a semi colon on the subscriptions, but first remove the username and tab or that will screw things up. then you need to compare form sumbitted subscriptions to textfile subscriptions list.

:confused::suicide:

 

Ok, let me get this right.  You have a Form.. FormA which POSTs to info.php

 

info.php displays a list of stuff dependent upon a text file and the username?

and sendinfo2.php .... adds to the text file?

 

Maybe it's the excess of forms, but I'm slightly confused.  What exactly is wrong?

 

You are nearly right, the info.php is just a list of the different categories. Banks, contrsuction, aeroplanes etc. When the user clicks on submit it will connect with sendinfo2.php to do the checking in the txt file to see if that user name has a subscription.

 

if the user does have a subscription it will come back with the information of the certain category they have subscribed to. So if it was banks. there is a txt file that would open on the page with the info. but for this example we have been given the banks.txt file just contains info like this is about banks....

 

 

 

 

Yea spiderwell has got it spot on.

This is the code I have..

 

For sign2.html

<HTML>
  <HEAD>
    <TITLE>Stock Market</TITLE>
  </HEAD>
  <BODY>
    <H1>Stock Market Sign-in Form</H1><HR>
    Welcome, customer!<P>
<form action ="info.php" method="post">
	Enter your name: <input type="text" name="CodeField">
	<input type="submit" VALUE="Submit">
  </form>
  </BODY>
</HTML>

 

For info.php

 

<head>
<title>Stock Market</title>
</head>

<body>

<h1> Please select which area of the stock market interest you</h1>


<form name="form1" method="post" action="sendinfo2.php">
  <p>
    <label>
      <input type="radio" name="stockinfo" value="Aviation and Aerospace">
    Aviation and Aerospace</label>
    <br>
    <label>
      <input type="radio" name="stockinfo" value="Banks">
      Banks</label>
    <br>
    <label>
      <input type="radio" name="stockinfo" value="Construction">
      Construction</label>
    <br>
    <label>
      <input type="radio" name="stockinfo" value="Electronics">
      Electronics</label>
    <br>
    <label>
      <input type="radio" name="stockinfo" value="Oil and Gas">
      Oil and Gas</label>
    <br>
    <label>
      <input type="radio" name="stockinfo" value="Pharmaceuticals">
      Pharmaceuticals</label>
    <br>
  </p>
   <input type="hidden" name="CodeField" VALUE="<?php echo $_POST['CodeField'] ?>"> 
  <input type="submit" name="submit" value="Submit">
</form>
</body>
</html>

 

For sendinfo2.php to do the check I do not have anything yet...

 

 

 

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.