Why use SERVER PHP SELF instead of

0 votes

In a form on a PHP page, you can use:

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

or

<form action="#" ...>

or

<form action="" ...>

In the action attribute of the form. Since echo $_SERVER['PHP_SELF'] does not pass variables for using GET and you have to use "", why would you use that or "#"?

Jun 25, 2022 in PHP by narikkadan
• 63,600 points
538 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
0 answers

when to use index.php instead of index.html

I wanted to know when do I ...READ MORE

May 30, 2022 in PHP by Kichu
• 19,040 points
635 views
0 votes
1 answer

What is the use of $_REQUEST variable in php?

Hii @kartik, The $_REQUEST variable is used to read the ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,840 points
3,288 views
0 votes
1 answer

How to merge two arrays while keeping keys instead of reindexing in php?

Hello, Considering that you have $replaced = array('1' => ...READ MORE

answered Apr 1, 2020 in PHP by Niroj
• 82,840 points
3,022 views
0 votes
1 answer

What is the use of the @ symbol in PHP?

Hello @kartik, The @ symbol is the error control operator ("silence" or "shut-up" ...READ MORE

answered Apr 9, 2020 in PHP by Niroj
• 82,840 points
12,030 views
0 votes
1 answer

How to merge two arrays while keeping keys instead of reindexing?

Hello, Considering that you have $replaced = array('1' => ...READ MORE

answered Apr 15, 2020 in PHP by Niroj
• 82,840 points
2,748 views
0 votes
1 answer

How to override the path of PHP to use the MAMP path?

Hello @kartik, In your home folder /Users/David for exmaple, you ...READ MORE

answered Nov 3, 2020 in PHP by Niroj
• 82,840 points
2,144 views
0 votes
0 answers

Getting PHP registration form to connect with MYSQL

I'm building a test site and my ...READ MORE

May 30, 2022 in PHP by Kichu
• 19,040 points
501 views
0 votes
0 answers

Undefined index error PHP

I'm getting this error: Notice: Undefined index: productid ...READ MORE

Jun 11, 2022 in PHP by narikkadan
• 63,600 points
548 views
0 votes
0 answers

How to call a PHP function on the click of a button

The two buttons on my functioncalling.php page ...READ MORE

Jul 24, 2022 in PHP by Kithuzzz
• 38,000 points
10,906 views
0 votes
0 answers

Form submit with AJAX passing form data to PHP without page refresh

Can anyone tell me why this bit ...READ MORE

Jul 29, 2022 in PHP by Kithuzzz
• 38,000 points
1,854 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP