Advertisement

07.22.2008 at 04:46AM PDT, ID: 23584757
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

How to submit java forms with PHP CURL

Asked by dedikate in PHP Installation, PHP and Databases, New to Java Programming

Tags: , ,

I'm trying to submit a form using PHP curl. but the action url of this form is in java. the action url is something like " javascript:document.oeForm.action='/se/comp?aff=intern';setCreationDate(1216726715056); groomForm('renew')"
I'm using a php curl script that i can easily submit any other forms that have something like
<form action="test.php">. but i dont know how to submit this java script
This is what i'm getting from source.
<form name="oeForm" action="/se/Edit?aff=intern" method="post" onsubmit="document.oeForm.action='/se/comp?aff=intern';setCreationDate(1216726715056);groomForm('renew');return false;">
Please help me on this , i'm a php noob. so...
Thank you in advance

This is the php script im using to curl  and submit the formStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
function GetCurlPage ($pageSpec) {
    
    $agent = "up.b";
    $header[] = "Accept: text/vnd.wap.wml,*.*";    
       $ch = curl_init($pageSpec);
      curl_setopt($ch,     CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch,     CURLOPT_VERBOSE, 1); ########### debug
    curl_setopt($ch,     CURLOPT_USERAGENT, $agent);
    curl_setopt ($ch,     CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch,     CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch,     CURLOPT_COOKIEJAR, "cook");
    curl_setopt($ch,     CURLOPT_COOKIEFILE, "cook");
       $tmp = curl_exec ($ch);
       curl_close ($ch);
    return $tmp;
}
function PostCurlPage ($pageSpec, $data) {
    
    $agent = "up.b";
    $header[] = "Accept: text/vnd.wap.wml,*.*";    
       $ch = curl_init($pageSpec);
      curl_setopt($ch,     CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch,     CURLOPT_VERBOSE, 1); ########### debug
    curl_setopt($ch,     CURLOPT_USERAGENT, $agent);
    curl_setopt ($ch,     CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch,     CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch,     CURLOPT_COOKIEJAR, "cook");
    curl_setopt($ch,     CURLOPT_COOKIEFILE, "cook");
    curl_setopt($ch,     CURLOPT_POST, 1);
    curl_setopt($ch,     CURLOPT_POSTFIELDS, $data);
    
       $tmp = curl_exec ($ch);
       curl_close ($ch);
    return $tmp;
}
 
$first = GetCurlPage("http://mywebsite.com/");
$exp = explode("=", $first);
$id = explode("\"", $exp[16]);
 
$second = PostCurlPage("http://mywebsite.com/".$id[0], "email=test@test.com&upassword=gkhgk");
 
 
[+][-]07.22.2008 at 05:51AM PDT, ID: 22058754

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.23.2008 at 07:53AM PDT, ID: 22069941

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Installation, PHP and Databases, New to Java Programming
Tags: Linux, Php curl, java, php curl, java
Sign Up Now!
Solution Provided By: dedikate
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628