Jump to content

PHP Get and PHP Post at the same time


randomguy1234

Recommended Posts

Hi.

I'm trying to do a PHP post and get at the same time, but I'm running into problems. Basically, the code gets some posted information, then does another post and at the same time does a GET to pass on the variables it acquired from the previous POST.

 

so, I get the POST information:

 

$maakond = $_POST['COUNTY_CODE'];

ETC

 

and then my next POST looks like this:

 

echo "<form name=\"majaleht3\" id=\"majaleht3\" method=\"post\" action=\"login.php?COUNTY_CODE=$maakond&CITY_CODE=$city_code&CITY_PART=$city_part&STREET=$tanav&HOUSE_NUMBER=$majanumber&show_on_company_page=$showoncompanypage&show_house_number=$showhousenumber&PLACENAME=$placename&CADASTRAL_NO=$cadastralno&asukoht_vald=$asukohtvald&REAL_ESTATE_NO=$realestateno&hidden_city=$hiddencity&hidden_city_part=$hiddencitypart&seller_name=$sellername&seller_phone=$sellerphone&seller_email=$selleremail&SPECIAL_OFFER_2_WEEK=$specialoffer2week&SPECIAL_OFFER_1_WEEK=$specialoffer1week&valid_thru=$validthru&REO_VISIBLE=$reovisible&priority=$priority&broker1=$broker1&broker2=$broker2&popup_map_onload=$popupmaponload&MAP_PICTURE1_id=$mappicture1id&MAP_PICTURE1_img=$mappicture1img&MAP_PICTURE1_map_area=$mappicture1maparea&MAP_PICTURE1_map_point=$mappicture1mappoint\">";

 

but instead of posting the link like this:

login.php?COUNTY_CODE=mypostedvalue&....

 

it posts it like this:

login.php?COUNTY_CODE=$maakond&....

Link to comment
Share on other sites

Well I see both GET and POST are available on submit so I'm not sure what issue you are having. 

POST values

Array
(
    [testpost] => ABC
    [submit] => test
)

GET values

Array
(
    [COUNTY_CODE] => maakondvalue
    [CITY_CODE] => city_codevalue
    [CITY_PART] => city_partvalue
    [sTREET] => tanavvalue
    [HOUSE_NUMBER] => majanumbervalue
    [show_on_company_page] => showoncompanypagevalue
    [show_house_number] => showhousenumbervalue
    [PLACENAME] => placenamevalue
    [CADASTRAL_NO] => cadastralnovalue
    [asukoht_vald] => asukohtvaldvalue
    [REAL_ESTATE_NO] => realestatenovalue
    [hidden_city] => hiddencityvalue
    [hidden_city_part] => hiddencitypartvalue
    [seller_name] => sellernamevalue
    [seller_phone] => sellerphonevalue
    [seller_email] => selleremailvalue
    [sPECIAL_OFFER_2_WEEK] => specialoffer2weekvalue
    [sPECIAL_OFFER_1_WEEK] => specialoffer1weekvalue
    [valid_thru] => validthruvalue
    [REO_VISIBLE] => reovisiblevalue
    [priority] => priorityvalue
    [broker1] => broker1value
    [broker2] => broker2value
    [popup_map_onload] => popupmaponloadvalue
    [MAP_PICTURE1_id] => mappicture1idvalue
    [MAP_PICTURE1_img] => mappicture1imgvalue
    [MAP_PICTURE1_map_area] => mappicture1mapareavalue
    [MAP_PICTURE1_map_point] => mappicture1mappointvalue
)

 

Here's my sample test page.

<?php

echo "POST values<pre>";
print_r($_POST);
echo "</pre>";
echo "GET values<pre>";
print_r($_GET);
echo "</pre>";

$maakond="maakondvalue";
$city_code="city_codevalue";
$city_part="city_partvalue";
$tanav="tanavvalue";
$majanumber="majanumbervalue";
$showoncompanypage="showoncompanypagevalue";
$showhousenumber="showhousenumbervalue";	
$placename="placenamevalue";
$cadastralno="cadastralnovalue";
$asukohtvald="asukohtvaldvalue";
$realestateno="realestatenovalue";
$hiddencity="hiddencityvalue";
$hiddencitypart="hiddencitypartvalue";
$sellername="sellernamevalue";
$sellerphone="sellerphonevalue";
$selleremail="selleremailvalue";
$specialoffer2week="specialoffer2weekvalue";
$specialoffer1week="specialoffer1weekvalue";
$validthru="validthruvalue";
$reovisible="reovisiblevalue";
$priority="priorityvalue";
$broker1="broker1value";
$broker2="broker2value";
$popupmaponload="popupmaponloadvalue";
$mappicture1id="mappicture1idvalue";
$mappicture1img="mappicture1imgvalue";
$mappicture1maparea="mappicture1mapareavalue";
$mappicture1mappoint="mappicture1mappointvalue";
echo "<form name=\"majaleht3\" id=\"majaleht3\" method=\"post\" action=\"test.php?COUNTY_CODE=$maakond&CITY_CODE=$city_code&CITY_PART=$city_part&STREET=$tanav&HOUSE_NUMBER=$majanumber&show_on_company_page=$showoncompanypage&show_house_number=$showhousenumber&PLACENAME=$placename&CADASTRAL_NO=$cadastralno&asukoht_vald=$asukohtvald&REAL_ESTATE_NO=$realestateno&hidden_city=$hiddencity&hidden_city_part=$hiddencitypart&seller_name=$sellername&seller_phone=$sellerphone&seller_email=$selleremail&SPECIAL_OFFER_2_WEEK=$specialoffer2week&SPECIAL_OFFER_1_WEEK=$specialoffer1week&valid_thru=$validthru&REO_VISIBLE=$reovisible&priority=$priority&broker1=$broker1&broker2=$broker2&popup_map_onload=$popupmaponload&MAP_PICTURE1_id=$mappicture1id&MAP_PICTURE1_img=$mappicture1img&MAP_PICTURE1_map_area=$mappicture1maparea&MAP_PICTURE1_map_point=$mappicture1mappoint\">";
echo "<input type=\"text\" name=\"testpost\" />";
echo "<input type=\"submit\" name=\"submit\" value=\"test\" />";
echo "</form>\r";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.