randomguy1234 Posted July 11, 2012 Share Posted July 11, 2012 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&.... Quote Link to comment https://forums.phpfreaks.com/topic/265535-php-get-and-php-post-at-the-same-time/ Share on other sites More sharing options...
Mahngiel Posted July 11, 2012 Share Posted July 11, 2012 likely a quoting issue. can't tell without seeing some relative code, tho. Quote Link to comment https://forums.phpfreaks.com/topic/265535-php-get-and-php-post-at-the-same-time/#findComment-1360851 Share on other sites More sharing options...
randomguy1234 Posted July 11, 2012 Author Share Posted July 11, 2012 Yeah, I know, I've tried almost everything. But I think I provided all information needed, because my code currently pretty much consists of these lines + a form that's 3000 lines long. Shall I copy the form? Quote Link to comment https://forums.phpfreaks.com/topic/265535-php-get-and-php-post-at-the-same-time/#findComment-1360856 Share on other sites More sharing options...
Drummin Posted July 11, 2012 Share Posted July 11, 2012 Why not pass these past values as hidden fields instead of using GET? Quote Link to comment https://forums.phpfreaks.com/topic/265535-php-get-and-php-post-at-the-same-time/#findComment-1360857 Share on other sites More sharing options...
randomguy1234 Posted July 11, 2012 Author Share Posted July 11, 2012 Instead of 20 lines I could wrap it up with 1 line. But I have thought about it and if I can't find the solution for this, I will do it like you suggested. Quote Link to comment https://forums.phpfreaks.com/topic/265535-php-get-and-php-post-at-the-same-time/#findComment-1360860 Share on other sites More sharing options...
Drummin Posted July 11, 2012 Share Posted July 11, 2012 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"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/265535-php-get-and-php-post-at-the-same-time/#findComment-1360882 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.