0

when i use <?php echo $_SERVER; ?> in my forms the get values disappears. How to fix that? Is there some function?

2
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by jcanaway
0

sorry need more information and some code examples on your problem also to help you

Edited by jcanaway: n/a

0

I just talked to a friend.

<form action="<?php echo $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']; ?>" method="POST">
0

alright first of all you wrote an echo function you do not use echo function for this type of print out because it will print out on the top of the document not where you want it to print out use the print() function this will work how you want it to

<form action="<?php print($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); ?>" method="POST">

also when you are using the form action="" tag and it is sending all the information back to the same page with the same QUERY_STRING as what the page is currently without adding any other QUERY to the string then you should use this

<form method="POST">

by removing the action Attribute on the form tag it will auto resubmit all sending information back to the same page like you are doing with this

<form action="<?php print($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); ?>" method="POST">

so the better line for faster loading when your send it back to the same script as what your on would be to use this

<form method="POST">

alright let me know if this helped and if you have any more questions just message me and ill try to help

Edited by jcanaway: n/a

0

alright first of all you wrote an echo function you do not use echo function for this type of print out because it will print out on the top of the document not where you want it to print out use the print() function this will work how you want it to

<form action="<?php print($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); ?>" method="POST">

also when you are using the form action="" tag and it is sending all the information back to the same page with the same QUERY_STRING as what the page is currently without adding any other QUERY to the string then you should use this

<form method="POST">

by removing the action Attribute on the form tag it will auto resubmit all sending information back to the same page like you are doing with this

<form action="<?php print($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); ?>" method="POST">

so the better line for faster loading when your send it back to the same script as what your on would be to use this

<form method="POST">

alright let me know if this helped and if you have any more questions just message me and ill try to help

Great post.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.