How to call one external php file and pass the parameters using PHP
Get the solution ↓↓↓I need one help. I need to pass some parameter to another php file and display it using PHP. I am explaining my code below.
user.php:
<?php
$product_id=$_POST['product_id'];
?>
I need to pass this parameter ($product_id
) to the following file by calling it.
saveUser.php:
<?php
$newCustomerobj->product_id =$_REQUEST['product_id'];
print_r($newCustomerobj);
?>
Here i need to pass the value fromuser.php
tosaveUser.php
.Please help me.
Answer
Solution:
If it need not be secure, then pass it as a query string like saveUser.php?id=product_id and access it using $_GET['id'].
Answer
Solution:
If you write a function as following
public function functionName($product_id, $variable 2,...)
{
require_once ('saveUser.php');
}
Then usually all variable will get in saveUser.php file. I don't know if it can help you.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: err_ossl_pem_no_start_line
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.