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 14 of 14
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Page forwarding html code

    Hello everyone!

    I need a html code to create a field where my users write the page name they want to read/view and forwards them to that page on my website. Thank you!!!!!

  • #2
    New Coder
    Join Date
    May 2009
    Posts
    44
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Are you expecting the User to "read/view" another page on your website? Or, are you looking to forward them to an external URL? You may be looking for javascript vs html/css.

  • #3
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello, Michaelbt2!

    I expect the user to read/view another page on my website by typing the name of that page. I just want to create a field where they write the page name, click enter, and they are forwarded to that page. Thanks.

  • #4
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,922
    Thanks
    15
    Thanked 229 Times in 229 Posts
    Quote Originally Posted by Dreamdreamer View Post
    Hello, Michaelbt2!

    I expect the user to read/view another page on my website by typing the name of that page. I just want to create a field where they write the page name, click enter, and they are forwarded to that page. Thanks.
    And what if they misspell the name? What's wrong with using the regular menu of links, such as appears on nearly every web page?
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,633
    Thanks
    0
    Thanked 649 Times in 639 Posts
    You can't do it with just HTML. You need a server side language to process the form when it is submitted and optionally some JavaScript to do the redirect without needing to submit.

    For example:

    Code:
    <form action="xfer.php" method="POST"><div>
    <label for="xfer">Next Page:</label>
    <input name="xfer" id="xfer">
    <input id="go" type="submit" value="Go">
    </div></form>
    <script type="text/javascript">
    document.getElementById('go').display = 'none;
    document.getElementById('xfer').onblur = function() {
    location.href = document.getElementById('xfer').value;
    }
    </script>
    and as xfer.php:

    PHP Code:
    <?php
     $xfer 
    $_POST['xfer'];
     
    header("location: $xfer");
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    Dreamdreamer (08-17-2013)

  • #6
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello, DrDOS!

    Thank you for your reply. It is a long story. Let me see if I can explain that in short words. My customers have their own subdirectory (password protected) on my website, where they can find and download individualized .pdf documents. I just want to create a link where they write their customer numbers (which is the name of the subdirectory) and they are forwarded to that place. Once in there, they just have to write their passwords and usernames. I am not an expert, so this is the simplest way for me.

  • #7
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello, Felgall!!

    Thank you for your help. Your script is perfect! However, users need to write the extension .html in order for it to work. How could this be modified to forward to a subdirectory instead of a page? Thanks!!!!

  • #8
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    why not jsut redirect them to the proper page once thier identity is established?

  • #9
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello, DanInMa!

    Because their identity is established after they get to their subdirectory. Once they get to their subdirectory, the system asks them for their username and password.
    Last edited by Dreamdreamer; 08-17-2013 at 06:47 AM.

  • #10
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    You can jsut have them login first and then provide the user with a link to their page, or redirect them to their page. You are kind of doing it backwards and forcing the user to take extra steps, that they really don't need to. Just seems like a very very odd way to do it.......

  • #11
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello, DanInMa! I don't think you understand my case. Maybe I am not explaining it correctly. My apologies. They can't login first. They need to get to their subdirectory first. At that moment the system asks them for their password. That is how .htaccess works. O course I can provide them with a direct link, but is easier if they just write their customer number and they are directed to their subdirectory.

  • #12
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    It not easier for the customer... oh forget it . I give up.

  • #13
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello, DanInMa!! I respect your opinion, of course. I know my users and how my page works. I was asking for a code. I thought you were going to provide one, but I was completely wrong on that. I appreciate your intentions, anyways.

  • #14
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hey, FelGall!

    I found the code that I was looking for in other forum that works perfectly for me, however, your code is pretty good and I will save it for future use. I really appreciate your help. Thank you!!!


  •  

    Posting Permissions

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