PHP?

PHP?

General — Page [1] 2
DiXi
Vouched

2005 Nov 17 • 121
26 ₧
i wanne make a "form"
like...
when someone post in the form....
the text will be sent to a other site.....

hmmm....
like this forum...
but i gonne make a password projected page...
and the "comments" from the form will be sent to the pw projected page...
but the point is....
how do i make a form who send the "comments" to another page???
example. sub.php

can someone help me?

btw my english suX
 
 
2006 Apr 4 at 03:26 PDT
Zarathustra
Monotheist

2005 Apr 30 • 315
167 ₧
Thus spoke Zarathustra.
 
 
2006 Apr 4 at 08:53 PDT
DiXi
Vouched

2005 Nov 17 • 121
26 ₧
"Zarathustra" said:
 
 
2006 Apr 4 at 12:06 PDT
Zarathustra
Monotheist

2005 Apr 30 • 315
167 ₧
OH!


...


...


...


...


Ok.

Carry on about your business.
Thus spoke Zarathustra.
 
 
2006 Apr 4 at 12:16 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
"index.php" said:

<form action=sub.php method=post>
<input type=text name=comments>
<input type=submit value='Click Me'>
</form>



"sub.php" said:

<?

echo $_POST['comments'];

?>

 
 
2006 Apr 4 at 14:26 PDT
DiXi
Vouched

2005 Nov 17 • 121
26 ₧
it wont save the "comments"

if example 3 ppl send a comment...
i can se nothing.....

i want it to save it
and i want to stay on the site were im write

like... when i sumbit... i want to stay at index.php
do yu know what to do?
 
 
2006 Apr 5 at 09:22 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
well thats more complicated. I was just giving you the first part.

Go to http://www.php.net/

if you want to learn about php.

You might need this:
http://www.php.net/manual/en/function.fopen.php
 
 
2006 Apr 5 at 15:26 PDT
Scorpian
Was: Tater Salad

Low Down Yellow-Bellied Star Stealin' Thief
Military Outstanding Volunteer Service
2005 Dec 1 • 85
25 ₧
Ooooorrr, if you don't want to learn another language, or think: CLICKY!
Go there, and search for a script somebody else worked their ass off to make.

^ Earn FREE money!
 
 
2006 Apr 5 at 18:27 PDT
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
hey sup?

how do you open some text document in and add a line into it on one page
and on the other page you open that file and add text

like shoutbox

can you tell me please
 
 
2006 Apr 28 at 05:47 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
[code:1]<?
$f = fopen( 'file.txt', 'a' );
fwrite( $f, "New line of text.\n" );
fclose( $f );
?>[/code:1]

The 'a' means 'append' which opens the file for writing at the end of it.
 
 
2006 Apr 28 at 16:28 PDT
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
thanks
 
 
2006 Apr 29 at 00:06 PDT
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
is it possible to write at the start of the file
 
 
2006 Apr 29 at 10:16 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
That's not as easy, but you can do it:

[code:1]<?
// FIRST read the file and load whats already in it:
$f = fopen( 'file.txt', 'r' );
while( $chunk = fread($f) )
$file_contents .= $chunk;
fclose( $f );

// SECOND clear the file, write the new first line, then
// write the old contents after that:
$f = fopen( 'file.txt', 'w' );
fwrite( $f, "New line of text.\n" );
fwrite( $f, $file_contents );
fclose( $f );
?>[/code:1]
 
 
2006 Apr 29 at 13:01 PDT
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
thanks
 
 
2006 Apr 29 at 13:10 PDT
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
is there a possibility that php generate default nuber itself
 
 
2006 May 17 at 07:29 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
nuber?
default number?
I don't know what any of this means?
 
 
2006 May 17 at 10:37 PDT
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
i mean number :)
 
 
2006 May 17 at 11:22 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
Ok, so you want to generate a 'default number'? What is a default number?
 
 
2006 May 17 at 12:56 PDT
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
lol a number that is created by the default
 
 
2006 May 18 at 05:42 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
OH do you mean a random number?

You can use mt_rand( 10, 999 )

That will get you a number between 10 and 999, but you won't know which one!!!! : D
 
 
2006 May 21 at 00:32 PDT
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
thank you

after all i don't need to know which one is created
 
 
2006 May 21 at 02:12 PDT
CornJer
Metal does cocaine.

Frontline Heroism Medal
2005 Mar 21 • 1531
36 ₧
Ive always wondered how a completely logical machine can create a random number.
If you jump high enough you'll hurt your ankles when you land.
 
 
2006 May 22 at 06:37 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
It's not really random. Every time you ask for a random number you just get the next number in a really long random-looking sequence of numbers. But each one is 100% predictable using the previous number.

The result is random-looking, but actually 100% logical/mathematical.

For example, let's say your get-next-number formula is this:

number = (previous + 189) % 256

% 256 means 'Mod 256' or 'get the remainder when dividing by 256'.

So let's say your first number is 200. Then to get the next number:

number = (200 + 189) % 256
number = (389) % 256
number = 133


And the sequence is: 200, 133, 66, 255, 188, 121, 54, ...

This example is more simple than random, but you get the idea...
 
 
2006 May 22 at 10:07 PDT — Ed. 2006 May 22 at 15:17 PDT
CornJer
Metal does cocaine.

Frontline Heroism Medal
2005 Mar 21 • 1531
36 ₧
So, if computers are logical, and if the universe is logical, then that must mean EVERYTHING is prechosen by the tinyist results from the big bang, right? Because if there is no way of making a real random number on a computer, who says they exist in real life. Which means we have no free will.

Why? Because all our decisions are influenced by things that happened. There is not a real choice.

If you jump high enough you'll hurt your ankles when you land.
 
 
2006 May 22 at 12:24 PDT
SuperJer
Websiteman

2005 Mar 20 • 6441
I agree except I don't know about the big bang. I think it is silly.

Free choice is a fun topic because you can't define 'free choice'

That's why it doesn't exist.

Is it free because it has no 'cause' and is therefore random? Ok, but then random isn't really a choice is it.

Or is your choice 'caused' by things like what you know and your personality? Ok, but then those exact causes define your choice. Still not really free.

What would it mean to be 'FREE choice'?
 
 
2006 May 22 at 15:09 PDT
Page [1] 2