Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2006
    Location
    eth0
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    edit string through php?

    Hi everyone,

    Is it possible, to have a input box, and the number that you have inputed, would change a certain number in another .php file?
    <? print("Hello World") ?>

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    maybe you could explain a little more about what you would like to do.
    currently i'm not really understanding what you want.

    -Ken

  • #3
    New Coder
    Join Date
    Jun 2006
    Location
    eth0
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK.

    I have 2 PHP files. The first one has an input box, and the second has some variables, and one of them is let's say $number. My task is to change the $number=X to $number=InputBoxNumber. Is this more clear?
    <? print("Hello World") ?>

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    so, you just want to submit a form and display the submitted data on the next page?

    just use:
    echo $_REQUEST['input_name'];

  • #5
    New Coder
    Join Date
    Jun 2006
    Location
    eth0
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx, but I want to actualy edit the file.
    <? print("Hello World") ?>

  • #6
    Regular Coder
    Join Date
    Sep 2005
    Posts
    394
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Writing to working files is not a good idea. You would need to look into fopen, fread and fwrite. You'd then write your number to a text file, and simply read it from the other php page.

    ~Phil~


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •