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 10:26 UTC
Zarathustra
Monotheist

2005 May 1 • 315
167 ₧
Thus spoke Zarathustra.
 
 
 
2006 Apr 4 at 15:53 UTC
DiXi
Vouched

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

2005 May 1 • 315
167 ₧
OH!


...


...


...


...


Ok.

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

2005 Mar 21 • 6670
"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 21:26 UTC
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 16:22 UTC
SuperJer
Websiteman

2005 Mar 21 • 6670
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 22:26 UTC
Scorpian
Was: Tater Salad

Low Down Yellow-Bellied Star Stealin' Thief
Military Outstanding Volunteer Service
2005 Dec 2 • 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 6 at 01:27 UTC
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 12:47 UTC
SuperJer
Websiteman

2005 Mar 21 • 6670
[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 23:28 UTC
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
thanks
 
 
 
2006 Apr 29 at 07:06 UTC
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
is it possible to write at the start of the file
 
 
 
2006 Apr 29 at 17:16 UTC
SuperJer
Websiteman

2005 Mar 21 • 6670
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 20:01 UTC
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
thanks
 
 
 
2006 Apr 29 at 20:10 UTC
bl00dy^b00t3r
2005 Jun 21 • 107
31 ₧
is there a possibility that php generate default nuber itself
 
 
 
2006 May 17 at 14:29 UTC
SuperJer
Websiteman

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

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

2005 Mar 21 • 6670
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 07:32 UTC
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 09:12 UTC
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 13:37 UTC
SuperJer
Websiteman

2005 Mar 21 • 6670
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 17:07 UTC — Ed. 2006 May 22 at 22:17 UTC
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 19:24 UTC
SuperJer
Websiteman

2005 Mar 21 • 6670
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 22:09 UTC
Page [1] 2