Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4013238
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:20:47+00:00 2026-05-20T09:20:47+00:00

I try to curl a page with a javascript submit process with out any

  • 0

I try to curl a page with a javascript submit process with out any luck… So I ask the community for some help!

Here is the form :

<script> 
    <!--
    function vallogin(){
        document.formlogin.action = "./index.php?vallogin=1";
        document.formlogin.submit();
    }
    -->
</script> 


<form name="formlogin" method="post"> 
<div class="headerblocgris"> 
<span class="txtnoir12">| Accès |</span> 
</div> 
<table width="100%"  border="0" cellspacing="0" cellpadding="0">                       
<tr>
<td class="txtnoir12">Login</td> 
<td><input name="txtlogin" type="text" size="15" /></td> 
<td><span class="txtnoir12">Password</span></td> 
<td> 
<input name="txtmdp" type="password" size="15" /> 
<input type="image" name="vallogin" src="images/bt_go.gif" align="absmiddle" /> 
</td> 
</tr>  
</table> 
</form> 

And my curl function :

{
         /**
         * Connexion
         */
        $URL = 'http://www.affiliatevista.com/index.php?vallogin=1';

        $data = array(
                    'txtlogin' => $this->login,
                    'txtmdp' => $this->passe,
                    'formlogin' => '',
                    'vallogin' => '',

                );
        curl_setopt($this->ch, CURLOPT_URL, $URL);
        curl_setopt($this->ch, CURLOPT_HEADER, true);
        curl_setopt($this->ch, CURLOPT_POSTFIELDS, $this->implode_array($data));
        curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->_getCookie());
        curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->_getCookie());
        curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
        $String = curl_exec($this->ch);
        echo $String;
    }

Thanks for your input, the code above doesn’t validate the form, I think I miss something with the submit validation process…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:20:48+00:00Added an answer on May 20, 2026 at 9:20 am

    I think you need to call the vallogin() function?

    I don’t see a submit button in your code, so something like:

    <input type="submit" value="Login" onclick="vallogin(); return false" />
    

    might work.

    Using JQuery and AJAX to do a post then return a result might be a better option though.

    http://api.jquery.com/jQuery.post/

    Or it could be you need an onsubmit=”vallogin()” in your form attributes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help with setting up a cURL request to a page. In
I try to get a page with curl from an IIS-Server which demands user
When I try to use curl or file_get_contents to read something like http://example.com/python/json/ from
Try executing the following in JavaScript: parseInt('01'); //equals 1 parseInt('02'); //equals 2 parseInt('03'); //equals
try it out: volatile float bob = -344.0f; unsigned int fred = (unsigned int)bob;
i get page in utf-8 with russian language using curl. if i echo text
I've made two versions of a script that submits a (https) web page form
I want to crawl some data out of a phpBB forum i'm a member
I'm using lib-cURL as a HTTP client to retrieve various pages (can be any
I'm in the process of making a little experiment, it grabs a YouTube page,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.