?
Solved

passing data from c++ to php

Posted on 2005-03-02
4
Medium Priority
?
284 Views
Last Modified: 2009-12-16
hey,
  well, i wrote a program in c++. from the program, i open a web site written in php. then i pass data to it, and populate some fields in a form on the site. the only say i can figure out how to do it is by creating a long string, first with the web site name, then a "?", and then append the data i want to pass. the problems are: 1. the person can see all the data in the address bar at the top, and 2. they can change the data by just changing the address bar and refreshing. i need a way to do it that either encrypts or hides the info in the address bar, or to pass the info another way besides that big long string. for those of you that know c++, i am using "shell execute" to open the web site from my program. i need help.

thanks,
P
0
Comment
Question by:struggling_coder_3203
[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
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
Batalf earned 900 total points
ID: 13444615
It's not possible to hide the data from the address bar. What you could do is to have a form which automatically submits the data to a new page with the post method.
example:

url: http://domain.com/yourPage.php

in yourPage.php

<form action="finalPage.php" method="post">
<input type="text" name="inputValue1" value="<? echo $_GET['inputValue1']; ?>">
<input type="text" name="inputValue2" value="<? echo $_GET['inputValue2']; ?>">
<input type="text" name="inputValue3" value="<? echo $_GET['inputValue3']; ?>">
</form>
<script type="text/javascript">
document.forms[0].submit();
</script>

Then pick it up the $_POST variables at finalPage.php

In yourPage.php you could have this body tag to prevent users from navigating back to it:

<body onload="history.forward()">
0
 
LVL 32

Expert Comment

by:Batalf
ID: 13444624
The point is..

The variable would in the address bar at yourPage.php, but they would be posted to finalPage.php right away and in finalPage.php you won't see them.

0
 
LVL 8

Assisted Solution

by:List244
List244 earned 300 total points
ID: 13445749
Shell Execute is a bad way to do this really.

http://support.microsoft.com/kb/q165298/

Maybe that can provide some help?
0
 
LVL 25

Assisted Solution

by:Marcus Bointon
Marcus Bointon earned 300 total points
ID: 13448394
This is not a PHP question at all - it's how to do an HTTP POST in C++. If you're happy using shell_exec, you should perhaps look at using CURL to do the request for you, or alternatively, link the CURL library in with your app. A library specifically for helping with doing that can be found here:

http://sourceforge.net/projects/easycurl/
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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.
Suggested Courses

777 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