Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Form Redirect using PHP instead of .ASP?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26951
    benryerson
    Participant

    I’m a photographer who designs, develops and maintains his own web site. For years I’ve been using the following bit of code to redirect my clients from a single-field form to the index file in directory containing their photo proofs. I’ve been using .ASP to do this.
    Here’s a link to my site: http://www.ryersonphotography.com

    The form in question is on the home page in the Client Login section in the bottom right.

    Here’s the form code:

    Code:


    And here’s the code for the showproofs.asp redirect:

    Code:
    <%response.redirect("/clients/" & request("sessionid"))%>

    Basically, the "sessionid" refers to the name of a folder in the "clients" directory. My client enters their session id (usually their name) in the form and submits it, the form calls the "showproofs.asp" file and the redirect locates the index.html file within the directory referenced in the form and it displays the page in the browser. Simple and easy. I don’t need it to be super-secure, just not instantly accessible to anyone who browses to my site.

    What I love about it is that, much like the PHP class ImgBrowz0r, there is no additional coding each time I want to set up a new gallery. I already have an automated process for creating the galleries and once I create a new folder in the "clients" directory, I’m done. The name of that new folder becomes the "sessionid".

    Here’s my problem: I’m switching to a hosting service that does not run .ASP on their servers. Fine. No big deal. What I want is another way to do this that doesn’t require .ASP. I would prefer something like jQuery or PHP but I’m not an experienced enough developer to get either of those to do what I want without help. Any suggestions are welcome.

    Thanks in advance!
    Ben

    #67133
    AshtonSanders
    Participant

    Sure,

    ASP:

    Code:
    <%response.redirect("/clients/" & request("sessionid"))%>

    PHP:

    Code:

    Is that the only ASP you use in that system?

    #67392
    benryerson
    Participant

    Thank you!
    It’s the last bit of ASP I use. I used to use ASP for image galleries but have since upgraded to a PHP class for that.

    As I am not a developer, I’m gonna play the ignorance card and ask how to implement your PHP solution for the redirect. Should it be it’s own separate file (that’s currently what I’m doing with the ASP) or should it be placed inside the page containing the form?

    Thanks again for the assistance!
    Ben

    #67404
    AshtonSanders
    Participant

    No Problem.

    It doesn’t matter too much how you do it.

    For simplicity, you might as well put it in the page that sends that the form redirects to.

    When you click "submit" on your form, the form is directed to a page. That page *does something* and after that code, put the PHP redirect…

    does that make sense?

    #67407
    benryerson
    Participant

    It makes perfect sense and it’s now up and running.
    Thanks so much for your help; it is greatly appreciated.
    Cheers!
    Ben

    #67408
    AshtonSanders
    Participant

    Excellent. And you call yourself a novice. ;)

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.