Nov 20, 2009
Pages: 1, 2

Transfer Variables To Another Php Script

free web hosting

Read Latest Entries..: (Post #11) by iGuest on Oct 7 2009, 08:08 PM.
Script driven self-submiting form Transfer Variables To Another Php Script koros- This is actually a javascript function. The code would be: [code]setTimeout( document.Formname.Submit(), 1000); //second parameter is time in milliseconds[/code] -Reply by Owen
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > MODERATED AREA > Computers > Programming Languages > PHP Programming

Transfer Variables To Another Php Script

kvarnerexpress
Hello,
I've one registration page where the users fills in their information, is it possible to trasnfer the things the fill in on the registration page to another script that does someting and returnes something to the first page like true/false and then the registration gives an error messange if the other php script returned false?

Something like the script "activates" another script that does something and returnes the result back to the original script.

Best Regards

Comment/Reply (w/o sign-up)

beeseven
Could you use a class? I'm not very experienced with classes in PHP, but would this work for your purposes?

(your first script)
CODE
include helperclass.php;
$result = Helper::activate($var1, $var2, ..., $varN);

(helperclass.php)
CODE
class Helper {
    function activate($var1, $var2, ..., $varN) {
         if(...)
              return true;
         else
              return false;
    }
    function otherStuff($var1, $var2, ..., $varN) {
         ...
    }
}

Comment/Reply (w/o sign-up)

Tyssen
QUOTE(kvarnerexpress @ Dec 26 2005, 12:20 AM)
Something like the script "activates" another script that does something and returnes the result back to the original script.

Sounds like you're talking about a form that submits to itself. Basically, the values will be captured by using the $_POST['formElementName'] and then you check to see if the form has been submitted already with if ($_SERVER['REQUEST_METHOD'] == "POST"). If it hasn't been submitted yet, you display the form, if it has you display something else.

Comment/Reply (w/o sign-up)

adly3000
i think that registering a session variables is easier, you can save the entered data from the user into a session variable then in any page you should write:
CODE
session_start();

then all the session variable will be defined.

Comment/Reply (w/o sign-up)

Spectre
I would suggest simply including (via 'include()') the script from wherever the form is sending its data ('action="page"'), as has more or less already been mentioned.

Depending on the method you instruct the form to use - ie. POST or GET - data entered in the form will be stored in either the $_POST or $_GET arrays respectively once it is submitted. So if you were to include() your script from the page that receives the data, the two abovementioned variables would be accessible.

Comment/Reply (w/o sign-up)

adly3000
$_post and $_get recieves the data entered in the last page which contains the form, but what do you have to do if you need it later?!
i think using $_session is better?

Comment/Reply (w/o sign-up)

Spectre
Using sessions is not always an option. Nor is it always desired. I try to avoid using cookie or session data wherever I can, and only ever do so if there is absolutely no other option.

PHP often appends the session ID to URLs where it has no other option for 'remembering' the session owner, meaning a link to, say, '/file.php' may become '/file.php?PHPSESSID=(some 32 byte MD5 hashed string)'. This is not only problematic when someone bookmarks or links to a certain page on your website, inadvertedly including the session ID, but also when search engines attempt to crawl your site. I seem to vaguely remember Google advising against the usage of sessions where possible due to the latter reason.

If you need to use data later, I would suggest storing it in a database (even a flatfile will do the trick where no other option is available). Remember that any files include()ed will have access to all variables declared on a global scope (such as $_POST), meaning that if the form submits data to 'page.php', and 'page.php' references 'script.php' via include() or require(), script.php will be able to access and manipulate the data received. If the information is not 'valuable' (for lack fo a better word) enough to store in a database, then you probably don't need to remember it outside of immediate processing anyway.

 

 

 


Comment/Reply (w/o sign-up)

FeedBacker
How to transfer variable from one page to another in php?
Transfer Variables To Another Php Script

I am going to make a login page. After my login I want to print username in in another page. How will I do?

-Imtiaz Alam Khan

Comment/Reply (w/o sign-up)

gamescoper
well as mentioned above you can use $_POST or $_GET or $_SESSION or $_COOKIE but each method has its pros and cons for example cookies can be created by the user manually and so can infiltrate your system

Comment/Reply (w/o sign-up)

iGuest-koros
script driven self-submiting form
Transfer Variables To Another Php Script

Hi, was looking for a way of writing a php script that would cause a form to submit itself after a timer expires. Thanks.

-question by koros

Comment/Reply (w/o sign-up)

Latest Entries

iGuest
Script driven self-submiting form
Transfer Variables To Another Php Script

koros-

This is actually a javascript function. The code would be:

[code]setTimeout( document.Formname.Submit(), 1000); //second parameter is time in milliseconds[/code]

-Reply by Owen



Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : transfer, variables, php, script

  1. How To Make Php Newsletter Script
    (3)
  2. Php Guest Online Script
    (3)
    make an index.php copy and paste this code CODE $db_host = "localhost"; $db_user = "root";
    $db_pass = ""; $db_name = "test"; $dbc = mysql_connect($db_host, $db_user, $db_pass); $dbs =
    mysql_select_db($db_name); $tm = time(); $timeout = $tm - (30*60); if($_SERVER ){$ip=$_SERVER ;}
    else{$ip=$_SERVER ;} $brws = explode("(",$_SERVER ); $browser = $brws ; mysql_query("DELETE FROM
    guest WHERE actvtime mysql_query("INSERT INTO guest SET  time='".$tm."',
    ip='".$ip."', browser='".$browser."'"); $count =
    mysql_fetch_array(mysql_query("SELECT COUNT(*)....
  3. How To Make A View New Post Script?
    (5)
    Ok so i'm still working on the forum software i posted about a while back, but I have no idea
    how to do this. I want to make a view new post script, as this is one of the main things that my
    forum software dose not have that all other forums have. so does any body have an idea on how i
    would do this? Thanks.....
  4. Guessing Php Script
    (2)
    I am looking for: freeware php quess the person in the photo game script....
  5. Need Help Installing Dolphin Community Script!
    (5)
    I'm not sure if this is the right place to post this but I really need help in installing the
    dolphin community script. I have absolutely no previous experience of scripts or programming. I
    would really appreciate if someone could walk me through it step-by-step, or even do it for me by
    logging into my cpanel. I have tried to install it my self but I'm a little confused. I'm
    sure it won't take very long at all for someone who has done this before.....
  6. How Do I Connect To Live Database With Php Script?
    while being hosted with ComputingHost (6)
    I am not new to programming. I want to create a form to add some values into my tables, the code
    are all working. But I am not sure what is the URL to connect to my site's database. All along,
    I have been testing through MAMP, which provides a local copy of mySQL. Can anyone lend me a hand?....
  7. Download Script For Mp3 Files
    (0)
    Hello, I'm looking for a download script for sound files (e.g. mp3, avi, wma, and other ones).
    i have found a few download scripts but they would not work for sound files for some reason. also
    this will not be used for allowing downloading of illegal or riped music, what i will be using this
    script for is i'm making a site for my church and the pastor wants to be able to recored the
    services and then have me upload them to the site so that the church members can download them for
    what ever reason. If some one could tell me how to make one or could show me a plac....
  8. Php Rediret Script
    (12)
    Ok, what I am trying to do is this. Re-direct a domain name called: avalon.asn.au to
    preschool.stmarksavalon.org.au I have created a script that will re-direct within the a folder.
    However, the avalon.asn.au and stmarksavalon.org.au are PARKED Domains. Any ideas on how to create
    this PHP Redirect Script please?....
  9. Forum Script
    (3)
    Hello, i'm wanting to start making my own forum software but i dont know where to start or what
    i need to know in order to do this. I know i will need php and mysql but what else, and could some
    one point me to a good site were i could learn php and mysql. Thanks ....
  10. How Would I Go About Making A Simple "counting" Script?
    (3)
    I plan on making a script for basic voting between different options, and I'd like to know what
    PHP coding I would require. Basically, each choice will be as simple as this: CODE Best
    falsetto? Person A Person B What PHP would be used to basically add 1 value to a
    specified .txt file based on which option is chosen? (Like, if person A was selected, it would add 1
    to persona.txt, and if person B was chosen, it would add 1 to personb.txt) Thanks in advance to
    whoever helps. I'm not good at this kind of intermediate/advanced PHP. /ph34r.gi....
  11. Library Script
    Where? (6)
    Hello, everyone. Anyone knows where I can get a library script that acts like CMS script software,
    you can add books or delete them. I want to build virtual online library which can be accessible to
    everyone. Or just give me some advices how to make it build. I'm a novice in programming.....
  12. Script Not Working
    I don't know why. (6)
    For some reason my random string script is not working. I got a fatal error when I tried it under
    XAMPP. I do not know why. It looks syntatically correct. Could someone help me? Here is the script:
    (Warning its over 100 lines long) //This PHP script will generate a random array and turn it into
    a string consisting of 0-9 and A-Z. // This is the first developmental version. //Create 10 item
    array for string $string = array(0,0,0,0,0,0,0,0,0,0); //Create function to replace 10-36 with A-Z
    function conToStr() { for ($a = 0;$a switch($string ) { case 10: $str....
  13. Script Help Required: Undefined Variable
    A fault I cannot spot in PHP (3)
    Hi, when running a PHP script I keep getting the error: QUOTE Notice: Undefined variable: bret
    in c:\program files\easyphp1-8\home\poll.php on line 294 Notice: Undefined variable: bret in
    c:\program files\easyphp1-8\home\poll.php on line 294 (And, yes, I get it twice). The code
    related to the variable is as follows: CODE function LogString($string,$type)     {
            $t_log = "\n";         $t_log .= $this->globaldata->server_vars ."|";         
            $t_log .= date("Y-m-d h:i:s A|");         $t_log .= "$type| ";         $string =
    str_replace("\n","\\n",$s....
  14. Php Downloads Script
    (4)
    I've been looking all over the net for a PHP script which can provide an interface to browse a
    downloads database. The database could be powered by MySQL. If you know a script like this, please
    post it here. Thanks in advance, Ironchicken.....
  15. Counting Variables?
    (4)
    Write a php script that will accept a positive integer, if it is even, divide it by 2 and if it is
    odd, multiply it by 3 and add 1. Repeat the process until the value is 1, printing out each value.
    Finally print out how many of these operations you performed. If the input value is less than 1,
    print error and perform an exit(); For example: Initial value: 9 Next value: 28 Next value: 14
    Next value: 7 Next value: 22 Next value: 11 Next value: 34 Next value: 17 Next value: 52 Next
    value: 26 Next value: 13 Next value: 40 Next value: 20 Next value: 10 Next value: 5 Nex....
  16. Will This Code Work
    php linking script ?p= (5)
    hi i'm not that great at php so i'm not to sure if this will work or not. but what i want to
    do is be able to use ?p=staff or what ever page name, with out the php extion, and i would like to
    no if this simple script i made would work. the code is: CODE $p = $_GET ; if ( !empty($p) &&
    file_exists('./' . $p . '.php') && stristr( $p, '.' ) == False ) { // pages
    = directory where you store your pages    $file = './' . $p . '.php'; } else { //
    1.php =  defult page    $file = './index.php'; } include $file; ?> ....
  17. Html Code Tester. Online Script
    (15)
    Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if
    this works. I have not tested it yet, but I will later and post back with a demo and fix it up.
    Current script: CODE //Save this as something like htmltest.php function CheckForm() {
    $html_unsafe=$_POST ; //Gives us our user input $html_safe=str_replace(" //Starts security measures
    $html_safe=str_replace("?>"," ",$html_safe); //User input now secure server side //Still security
    issues client side echo $html_safe; //echos our statement } //End function //Main script....
  18. Very Simple Online Now Script
    This is a very simple online now script. (4)
    Hi all, Its Aldo. anyways, I wont be using the method of pagination, i will just tell you how to
    make a basic online now script. When someone logs in, now take into consideration that the name of
    the username input is username ( First ,create a table in your database saying online now and add 2
    fields to it. id and username CODE id type=integer(INT) , auto increment, length =255 and
    username = VARCHAR length=the limit a username should be in your site now from there we take off
    : CODE //logged.php //authentication script //connection script //if connectio....
  19. Creatting A Playlist Through Php
    script help needed (5)
    Hi I am trying to make a script so that i can insert songs into a playlist, but i need a script in
    which it opens the playlist file and removes the closing tag at the end, so before i can add more
    entrys. e.g CODE Location 5 Location 4 Location 3 Location 2 Location 1 But to
    add more entrys i would have to get rid of the atx, then use the fputs to place the new entry into
    the file. code tags added Topic title modified. ....
  20. Sending $_get[] Variables To An Application
    (5)
    I'm trying to work out if it is possible to send variables to a application on server. E.g
    send the variable of id which is equal to 10 to an application - test.exe?id=10 Any ideas to see if
    this is possible?....
  21. What Kind Of Script Do You Need ?
    post here and get free script (15)
    Hi everybody sorry if i posting here , i know I want design free PHP script and i dont know
    webmasters what kind of scripts want i think its better to aks here becuase trap17 is very nice
    webmasters forum So , Plz post here what kind of script with details you need ! sorry may en is
    not very well for example you need "upload center" : write "upload center" with upload center
    options ( like Ajax , Fast , multi lan and ... ) with this post we can give script details and
    webmasters idea /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif"....
  22. Wappy Buddy V1.10 - Tibia Gold Edition By Wappy & Jon Roig
    the official wap download script (3)
    By downloading this script you are agreeing to the license and terms outlined below /biggrin.gif"
    style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> QUOTE /** * *
    @package: wappyBUDDY - Tibia Gold Edition * @version: 1.10 2006/10/01 00:00:01 wappy * @copyright:
    ©2003, 2006 jon roig, wappy * @release notes: this is the first official release of my download
    script despite pirate and incomplete copies floating around that were stolen from one of my previous
    servers. The next release will follow very shortly * @terms: wappyBUDDY is free softw....
  23. Free Auction Script
    Any Suggestions? (7)
    Any free auction script suggested? I want it to be as many practical functions as possible, yet
    easy to manage. And more importantly, it is free! Appreciate your kind suggestions!....
  24. Wappychat_oldskool
    old version of my wap chat script :-) (15)
    here is a very old version of my wap chat script, its not very advanced but has privates, smileys
    etc. I will post some further versions (with owner, admin, mod status and profiles) when i have time
    to write the readme/install instructions for them. You will find instructions inside the zip. If you
    have any problems post here but i know it don't work on all servers for some reason but it does
    work on the trap server so will be cool ok /tongue.gif" style="vertical-align:middle" emoid=":P"
    border="0" alt="tongue.gif" /> ....
  25. Script That Tracks The User Status
    how can I track on or offline users? (4)
    long explaination: hey, I'm building a user profile site right now. And, I kinda know how to
    make a online/offline detector, but not totally sure. I know I can make a mysql database to track
    them, but how does it entrer the information? I could easily put in a field where when they login it
    sets them to online, but if they don't sign out, and just exit the browser, how can I tell.
    short: I want someone to tell me how to make a online/offline status detector, like they have here
    on trap17. I'd be thrilled if you can post to this, thanks, arcticsnpr....
  26. Watermark Your Image With Simple Php Script
    found it on the net (39)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE // this script creates a watermarked image
    from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly transparent
    gif image with the watermark - goes in the same directory as this script // where this....
  27. Parse: Error Unexpected T_lnumber
    php parse error when running script (4)
    Hi. I've just created a php script. The main object of the script is to delete some old files
    and replace it with a new file with some new content, effectively moving the contents from one file
    to another. These are the first 50 lines of the file: /* Calculate For The "A" Group - The
    Latest Games ID */ $a_B = 002; while(file_exists("a_" . $a_B . ".dat")) { $a_B++; }
    $new_page_contents = " " . $_POST . " " . $_POST . " include
    \"/home/cmatcme/public_html/footer.php\"; ?> "; $a_stream = fopen($a_B . ".cmat", "w+");
    fwri....
  28. Php News Script
    how to make news script that uses MySQL writen in PHP (20)
    How to make a News script with PHP + MySQL So..in this tutorial i will explain how to create PHP
    news script. first we have to create the table in My SQL.. with the code below you will do this (
    you have to enter it into SQL field ..in PHPmyADMIN) CODE CREATE TABLE news ( id int(10)
    unsigned NOT NULL auto_increment, postdate timestamp(14) NOT NULL, title varchar(50) NOT NULL
    default '', content text NOT NULL, PRIMARY KEY (id), KEY postdate (postdate), FULLTEXT KEY
    content (content) ) >>>> script files 1 file will show the news ,1 file will....
  29. Script: Php Jukebox
    A one file script! (6)
    This scripts is so simple, you dont need to edit ANY of it! All you have to do is make a folder
    called 'songs' and put some audio files in it. Here is the whole page, I named it index.php
    and put it in a folder called 'music': CODE PHP jukebox ©2005 Craig lloyd.
    All rights reserved. Visit cragllo.com for more scripts --> /** * ©2005 Craig lloyd. All rights
    reserved. * * Mod Title:           Simple PHP Jukebox * Author:              Craig Lloyd * Author
    Email:        cragllo@cragllo.com * Author Homepage:     http://www.cragllo.com/ * Des....
  30. Many Php Script Sites
    (18)
    Hi I find many sites has PHP scripts :: QUOTE http://www.proxy2.de/scripts.php
    http://www.free-php.net http://knubbe.t35.com/ http://www.ngcoders.com/
    http://www.oxyscripts.com/ http://www.phparena.net/ http://www.1phpstreet.com/
    http://px.sklar.com/ http://www.scoznet.com/ http://php.resourceindex.com/ /blink.gif"
    style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" />....

    1. Looking for transfer, variables, php, script

Searching Video's for transfer, variables, php, script
See Also,
advertisement


Transfer Variables To Another Php Script

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com