Solved

Classic ASP, VBScript sending form POSTS to PHP

Posted on 2008-10-29
5
401 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

707 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