Originally posted by kickme21
I am trying to have scrips were I can continue to use the veriable with a different php file. Looking over some scrips there is like
funtion users_log($user)
How would u do that and if I would need to use the function command when I do want to run it how to relate to it.
Ok, let's start with the basics. How to get help at all, as an example. Not that your subject line is overly dumb, or you can't use the shift key; but maybe English isn't your primary language? OTOH ... :eek:
Seriously, I hope I can answer your question. I'm not sure I complete understand what you're asking.
The RTFM answer: [man]functions[/man].
The STFW answer: PHP user-defined functions, courtesy of Google®.
The board answer (if other than the above). If you are asking about functions, we often do this:
<?php
include 'myfunctions.php';
$now=time();
$myvariable=mycoolfunction($now);
?>
... so one function can be used anywhere by [man]include[/man]'ing its source file.
If you are asking about carrying variables from one script to another, then you have a few choices.
put it in the query string ($GET method)
POST it via a form ($POST method)
assign it to the $SESSION array
assign it to the $GLOBALS array
write it to a file, then read it on the next page
write it to a (relational) database, then read it on the next page ...
And, if you're asking about something else, I guess I'm sorry.....