A php that adds lines to other php's

Okay, I want a html/php that asks someone “Username:” “Password:” When they fill that out it’ll redirect to a page(php) that adds ‘theiruser’ => ‘theirpass’ to another .php

I tried everything, can someone just give me something simple? I don’t have mysql

Hi there,

Look into the commands; fopen,fwrite,fclose:

It’s used like so:
$fhandle = fopen(“includes/edited.php”,“a”);
fwrite($fhandle,“Name:”.$theirname." - Pass:".$theirpass);

Although there may be problems in my example as I’ve only written this quickly and not tested it =/

Let me know how it goes

You obviously know what you’re talking about, thanks so much.

It looks like you just want to pass the password value to another page, right? I am also assuming that the page you are passing it to is under your control scope (you are designing it). If not, then this is a hacking question and I hate you.

If so, there are multiple ways to do this. I typically like to use session variables for this because they are not passed in the URL, do not require any file reads/writes, are easy to implement, and are extremely effective.

In essence, you will start the page by adding:
this will allow you to use session variable scope.

After a user enters in their form information (and the form does a post operation), you can inspect the value and put it into a session variable.

OR, have the form redirect to another page and have that page inspect the $_POST[] value being passed to it.

Sponsor our Newsletter | Privacy Policy | Terms of Service