Jump to content

arnoldd99

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

arnoldd99's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Still no luck. Here is the code for the first page <?php session_start(); $username=$_POST['username']; $_SESSION['username']=$username; ?> <html> <head> <?php $username=$_POST['username']; $data="$username \n"; </head> <body> <?php $fh=fopen("$username.txt","a"); fwrite($fh,"$data"); fclose($fh); print("Details sumbitted"); ?> <form action="userPage.php" method="POST" /> <input type="submit" value="click here to continue" /> </form> </body> </html>
  2. When i filled out the form, i entered the user name nick and nick appeared when i clicked ok. However it still doesnt appear on userPage.php
  3. sorry i wasnt very clear with my last post: I have two pages, the first feeds.php <? session_start(); $username=$_SESSION['username']=$_POST['username']; ?> <?php $username=$_POST['username']; ?> The second page userPage.php <?php session_start(); $_SESSION['username']; $username=$_SESSION['username']; print ($username); ?> Is there still nothing assinged to the session variable?
  4. I have done this but when i go to echo the variable to check the contents is there nothing appears. Code i used: $_SESSION['username']; $username=$_SESSION['username']; print ($username);
  5. Im having trouble with sessions. I want to create a variable that is avaliable for all pages of my site. The variable is determined by user input from a form. I have managed the first part: $username=$_POST['username']; I then wrote this for my session variable <? session_start(); $username=$_SESSION['username']=$_POST['username']; ?> How do i use this variable on another page.
  6. Hi, I need to create a different text file every time a user registers. Currently every time a user registers there details are sent to "users.txt". So all user details are in the same text file. I would idealy like each text file to be named after the username registered. Here is the code currently being used: $username = $_POST['username']; $password = $_POST['password']; $data = "$username, $password /n"; $fh = fopen("users.txt", "a"); fwrite=($fh,"$data"); fclose=($fh);
×
×
  • 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.