I want to pass the variable from php page to another without using sessions.
here's SearchCustomer.php page which have the from
<form action="controllers/Customer.controller.php" method="post">
<label for="cellPhoneNo">cell phone number</label>
<input type="text" name="cellPhoneNo" class="textField"/>
<span id="cellphonePrefix"></span>
<label for="telephone">telephone </label>
<input type="text" name="telephone" class="textField"/>
<input type="submit" name="searchCustomer" value="بحث"/>
in Customer.controller.php I search for customer and return a $result, I want to pass the variables defined in Customer.controller.php to SearchCustomer.php page which the from is submitted from without using sessions.
You can achieve this with hidden input controls.
In Customer.controller.php:
echo "<input type='hidden' name='result' value='{$result}'>";
In SearchCustomer.php:
$passedResult = $_POST['result'];
Update: Question did change a bit, use a redirect similar to this:
header("Location: http://yoursite.com/SearchCustomer.php?result={$result}");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With