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

  • SEARCH
  • Home
  • 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 6191615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:47:50+00:00 2026-05-24T02:47:50+00:00

I want to send data from one php file to other php file to

  • 0

I want to send data from one php file to other php file to authenticate a user . None of them can be html files . And I cant send it as header as it appears in the url . Plz give me some suggestions.

  • 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-24T02:47:51+00:00Added an answer on May 24, 2026 at 2:47 am

    You can use CURL for this, to send a secure POST request, even if the receiver script is on another server. That will not expose anything in the URL, however Firebug may be able to see the request. To get around this, simply make sure that your auth key and the password that is being sent, are hashed.

    Something like this (untested)

    Here is the sender script

    <?php
    
    ///// Sender.php ///////
    
    //Set up some vars
    $url = 'http://domain.com/Receiver.php';
    
    $user = 'someusername';
    $pw = 'somepassword';
    $auth_key = 'YourSecretAuthKey';
    
    $fields = array(
                'auth'=>urlencode($auth_key),
                'user'=>urlencode($user),
                'pw'=>urlencode($pw)
            );
    
    // Init. string
    $fields_string = '';
    // URL-ify stuff
    foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
    rtrim($fields_string,'&');
    
    //open connection
    $ch = curl_init();
    
    //set the url, number of POST vars, POST data
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_POST,count($fields));
    curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
    
    //execute post
    $result = curl_exec($ch);
    
    //close connection
    curl_close($ch);
    
    
    ?>
    

    And the receiver script:

    <?php
    
    ////// Receiver.php //////
    
    if(!isset($_POST['authkey']))die('Error: No Auth Key');
    if(!isset($_POST['user']))die('Error: No Username!');
    if(!isset($_POST['pw']))die('Error: No password!');
    
    $auth_key = $_POST['auth'];
    $correct_authkey = 'YourSecretKey';
    
    if($auth_key!=$correct_authkey)die('WRONG AUTH KEY!!!!');
    
    $user = $_POST['user'];
    $pw = $_POST['pw'];
    
    //// Here you can process your username and password
    
    ?>
    

    A POST request is pretty secure, but if you are handling crucial information, you could always hash the auth key and password. Hope this helps.

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

Sidebar

Related Questions

In HTML, you can send data from one page to another using a GET
I want to send data from one page to the other via a form
i am trying to send email from php i have one php file with
Can anyone tell me the best way to send some xml data from one
I use method=get to send my data from one webform to the other. But
I want to send emails where the data is from a php/mySQL query. I
In my program, I stat the files they want and send the data over.
I want to send ViewData.model to Special action with the last user data entry.
I have this file 'gardens.php' , which pulls data from a table called 'generalinfo'
My PHP file doing 2 operations: 1. Submits data from form into db table,

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.