Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Need Help Scripting Php!

  1. #1
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Unhappy Need Help Scripting Php!

    I need help in a php script. I want to make a form which, when user enters a name it adds it to my link and shows this link in iframe.
    eg

    <form action="Untitled-10.php" method="post">
    Name:
    <input type="text" name="name" />
    <input type="submit" value="Submit!"/>
    </form>

    i would like the name to be placed in a link eg http:yourname.com/"name"/free

    could someone help me get the name into the speechmarks and show the url in an iframe. thx for looking/helping in advance.

    i am wondering wat goes inside the other php file i got "Untitled-10.php".

    PLEASE HELP ME OUT!!

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    So you mean each user would have there own directory?
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    darshan1994 (12-31-2008)

  4. #3
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    its not for each user to have their own directory but thats a eg

  5. #4
    Join Date
    Dec 2008
    Location
    Fremont, CA
    Posts
    30
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default

    File A : Test.html (assumed)

    Code:
    <form action="Untitled-10.php" method="post">
    Name: 
    <input type="text" name="name" />
    <input type="submit" value="Submit!"/>
    </form>
    File: Untitled-10.php
    PHP Code:
    <?php 
    $name 
    $_POST['name'];
    if(
    $name!=""){
    $redirectedURL "http:yourname.com/".$name."/free";
    header('Location: '.$redirectedURL );
    exit;
    }else{ 
    //user entered no values, u can use javascript on test.html for validation otherwise.
    header('Location: Test.html');       //you can set a session message if you like by using $_SESSION['<name>'] for notification or if sessions aint good, check out $_GET
    exit;
    }

  6. The Following User Says Thank You to l_kris06 For This Useful Post:

    darshan1994 (12-31-2008)

  7. #5
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    its gonna be like a search engine where they type and the script does the work and show them the page

  8. #6
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    kris thx but could u get that script into iframe, i am very newbie to php

  9. #7
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I would not suggest using an iframe... Ajax is highly suggest by me though.
    Jeremy | jfein.net

  10. The Following User Says Thank You to Nile For This Useful Post:

    darshan1994 (12-31-2008)

  11. #8
    Join Date
    Dec 2008
    Location
    Fremont, CA
    Posts
    30
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default

    I dint quite really get what you are looking for.

    you wanted somebody to type a text and then pass that value in the URL and show the result in an iframe ? is that rite?

    Best,
    Kris A

  12. The Following User Says Thank You to l_kris06 For This Useful Post:

    darshan1994 (12-31-2008)

  13. #9
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    niles (i don't understand ajax at all) i need iframe i can place in one of my page

  14. #10
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    You don't have to code raw ajax. You can use jQuery.
    Jeremy | jfein.net

  15. The Following User Says Thank You to Nile For This Useful Post:

    darshan1994 (12-31-2008)

Bookmarks

Posting Permissions

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