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 in PHP by narikkadan
• 11,280 points
12 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 in PHP by Kichu
• 19,040 points
24 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,740 points
812 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,740 points
896 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,740 points
4,561 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,740 points
1,401 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,740 points
773 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 in PHP by Kichu
• 19,040 points
22 views
0 votes
0 answers

Undefined index error PHP

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

Jun 11 in PHP by narikkadan
• 11,280 points
77 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 in PHP by Kithuzzz
• 3,480 points
21 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 in PHP by Kithuzzz
• 3,480 points
5 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP