Solved

Classic ASP, VBScript sending form POSTS to PHP

Posted on 2008-10-29
5
405 Views
Last Modified: 2010-04-21
Greetings EE Gods.
I have to combine VBScript from Classic ASP with a PHP formmail.

The formmail takes a post from a html form I cannot change.
However, If I could send the information as a session_variable???? to the php document via VBScript, that would suffice as a replacement.

How can I send "session_variables"??? to a php page, where the php page thinks it came from a form post?


Thanks
0
Comment
Question by:Evan Cutler
5 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 22829001
>>How can I send "session_variables"??? to a php page, where the php page thinks it came from a form post?

if you mean create session variables within php pages, you MUST then create it in your php scripting, you cannot "pass" session variables across different scripting languages.
0
 
LVL 58

Expert Comment

by:tigermatt
ID: 22829262

As has already been mentioned you cannot create a session variable in ASP and use that in a PHP script; they are incompatible.

What you could do on your ASP code is to build a Post Request, using the form data, and send that to the PHP page. This would mimic exactly a form which has the method="post" attribute assigned, and would pass the variables to the PHP form mailer. There's a good example of building a post request in ASP at http://www.asp101.com/samples/viewasp.asp?file=http_post.asp. If you need any more help, let me know.

-tigermatt
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 22830304
I think you MUST change the HTML form to get this information across from ASP to PHP.  There is no cross-pollination between the systems (believe me, I have tried!)

But the good news is that the appearance of the form in your browser does not need to change.  Extract the session variables you need and send them across as hidden form inputs like this:

<input type="hidden" name="ASP_SESSION_VAR_1" value= [your session data field #1] />
<input type="hidden" name="ASP_SESSION_VAR_2" value= [your session data field #2] />

In the PHP side of things, you will find these data fields in $_POST["ASP_SESSION_VAR_1"], etc.

Good luck, ~Ray
0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 31511067
Didn't look right when I did it.
but it worked.

Great stuff.
Thanks
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 22967997
Thanks for the points!  Glad I was able to help. ~Ray
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now