Jump to content

Sending values to another page.


thangappan

Recommended Posts

Is there any way to send array (both types) values to another page using GET method.

For an example.

 

$table_name = contacts;

$attributes = array("First_name" => "first_name");

echo "<script language=\"javascript\" > window.location=\"Pagination.php?Value=$table_name:$attributes;\";

</script>

 

While doing the above code, $table_name passed correctly as contacts.But $attributes passed as string `Array`. Could you please solve my problem.

Link to comment
https://forums.phpfreaks.com/topic/143075-sending-values-to-another-page/
Share on other sites

I need to retain the value after sending to another page.Is there any way in php.

For an example,

 

http_build_query($data) It returns string as val=contacts&attr=head&first_name=thanga

I want to retain all the values into an array.

 

Could you please solve my problem with correct explanation.

 

page1.php:

<?php
$data = array("First_name" => "first_name");
echo '<a href="page2.php?' . http_build_query(array('data' => $data)) . '">Next page</a>';

 

page2.php:

<?php
echo '<pre>' . print_r($_GET['data']) . '</pre>';

 

Or, so you don't have to constantly worry about the validity of the data, just use sessions.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.