Solved

Classic ASP, VBScript sending form POSTS to PHP

Posted on 2008-10-29
5
411 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 52

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 110

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 110

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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.

739 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