PDA

View Full Version : PHP help ...



vito201-:D
05-05-2008, 11:35 AM
Now, i'm not a fan of PHP - it's HTML, xHTML, sHTML, Java all the way for me but i decided that probably the most secure logins are PHP based, this being the case I set off on a mission to make a PHP login but came accross a little hitch that means it simply does not work - basically it only reads about 50% of the page as PHP and the rest it seems to assume is HTML =/

For instance PHP_SELF should run the script to the current PHP page if i'm not mistaken? but instead this piece of code:
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

is intent on trying to find a page called:
<?=$_SERVER['PHP_SELF']?>

See, in HTML i'd assume that to happen as it's in inverted commas but... I assume PHP is meant to do something else? ... Lol. yeah so any help would be ... helpful x]

RyzerFoo
05-05-2008, 11:56 AM
Now, i'm not a fan of PHP - it's HTML, xHTML, sHTML, Java all the way for me but i decided that probably the most secure logins are PHP based, this being the case I set off on a mission to make a PHP login but came accross a little hitch that means it simply does not work - basically it only reads about 50% of the page as PHP and the rest it seems to assume is HTML =/

For instance PHP_SELF should run the script to the current PHP page if i'm not mistaken? but instead this piece of code:
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

is intent on trying to find a page called:
<?=$_SERVER['PHP_SELF']?>

See, in HTML i'd assume that to happen as it's in inverted commas but... I assume PHP is meant to do something else? ... Lol. yeah so any help would be ... helpful x]

If its looking for <?=$_SERVER['PHP_SELF']?> then rename it to that..

Should work.. :)

Invent
05-05-2008, 11:58 AM
If its looking for <?=$_SERVER['PHP_SELF']?> then rename it to that..

Should work.. :)

lol!

Have you tried using the full syntax? (<?php) instead of using short-tags as your server might not have them enabled.

Jackboy
05-05-2008, 12:10 PM
Now, i'm not a fan of PHP - it's HTML, xHTML, sHTML, Java all the way for me but i decided that probably the most secure logins are PHP based, this being the case I set off on a mission to make a PHP login but came accross a little hitch that means it simply does not work - basically it only reads about 50% of the page as PHP and the rest it seems to assume is HTML =/

For instance PHP_SELF should run the script to the current PHP page if i'm not mistaken? but instead this piece of code:
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

is intent on trying to find a page called:
<?=$_SERVER['PHP_SELF']?>

See, in HTML i'd assume that to happen as it's in inverted commas but... I assume PHP is meant to do something else? ... Lol. yeah so any help would be ... helpful x]


<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

You have two ='s

Its basically saying <form action==$_SERVER[PHP_SELF>

And u could just use $PHP_SELF

Excellent
05-05-2008, 12:14 PM
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

You have two ='s

Its basically saying <form action==$_SERVER[PHP_SELF>

And u could just use $PHP_SELFDo you know what your talking about? He couldn't just use $PHP_SELF because the form wouldn't pick it up, he needs the = signs.

Decode
05-05-2008, 12:31 PM
Use full opening tags!

<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">

Excellent
05-05-2008, 12:35 PM
Use full opening tags!

<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">Some servers don't read short tags thats why you should always use full tags kids!

vito201-:D
05-05-2008, 08:21 PM
So erm... what should I do? Lol >_> I'ma try each of the ideas see what happens ;D


If its looking for <?=$_SERVER['PHP_SELF']?> then rename it to that..

Should work.. :)

Er... >_> I think i'll ignore that comment...



lol!

Have you tried using the full syntax? (<?php) instead of using short-tags as your server might not have them enabled.

No luck it now tries to find "<?php=$_SERVER['PHP_SELF']?>"



<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

You have two ='s

Its basically saying <form action==$_SERVER[PHP_SELF>

And u could just use $PHP_SELF
Nope, didn't seem to work D;


Use full opening tags!

<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
"<?php echo $_SERVER['PHP_SELF']?>" is now being looked for =[


Could it be that the server i'm using doesn't allow some of the PHP code i'm using? ... anyone give me a good free-PHP site i can upload some stuff to and test out?

SmileUK
05-05-2008, 09:22 PM
Try:
<form action=\"<?php echo $_SERVER['PHP_SELF']?>\" method=\"post\">

not sure though, don't know php.

Agnostic Bear
05-05-2008, 10:32 PM
Yeah here's a tip:

<form name="dongs" method="post" action=""> will do just fine.

--ss--
06-05-2008, 11:22 AM
So erm... what should I do? Lol >_> I'ma try each of the ideas see what happens ;D



Er... >_> I think i'll ignore that comment...




No luck it now tries to find "<?php=$_SERVER['PHP_SELF']?>"



Nope, didn't seem to work D;


"<?php echo $_SERVER['PHP_SELF']?>" is now being looked for =[


Could it be that the server i'm using doesn't allow some of the PHP code i'm using? ... anyone give me a good free-PHP site i can upload some stuff to and test out?
www.x10hosting.com ;).

Jackboy
06-05-2008, 11:25 AM
Type phpinfo(); or summin, see if your host supports them w/e etc

Want to hide these adverts? Register an account for free!