Solved

Classic ASP, VBScript sending form POSTS to PHP

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

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 109

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 109

Expert Comment

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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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.

809 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