Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am wondering why is that the $_SERVER['DOCUMENT_ROOT'] is not working in my code in echo with html option tag?
This is my sample:
echo "<option value='".$_SERVER['DOCUMENT_ROOT']."'/acces/login/validate?employee=".$login->employee()."&password=".$login->get_pwd()."'>LOGIN</option>";
It's generally a bad idea to reveal your document root, especially as there is no need for it in the browser. That aside, though, you should always look at the rendered HTML:
<option value='/path/to/doc/root'/acces/login/validate?employee=steve
&password=use plaintext and die'>LOGIN</option>
(Line wrap added to avoid ugly horizontal scrollbar)
See that extra ' after the doc root? That'll be your problem.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Does php work in phonegap? I cannot find the answer.
I ask as javascript works for sure.
Thank you
Short answer no.
Insert Code here
You should really look at improving your knowledge of language types first. Php is server side based.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I wanna clear the content of a file called txt.txt by clicking a link. I've looked through the site and Googled up a storm but can't figure it out. I know there are threads here that talk about it but nothing explain exactly how to do it. Thank you :o)
Clean with:
$fn=fopen('txt.txt','w');
fclose($fn);
Delete with:
#unlink('txt.txt');
This will clear the file and all its content (without deleting it)
I don't know routing in your app, try this logic)
clearfile
//in clearfile.php
<?php
file_put_contents('', 'txt.txt');
header('Location: ' . $_SERVER['HTTP_REFERER']);
die;
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
hi i take look inside some php files and find that the php inside is hidden or encrypted ,it's like this
<?php
echo "<div\x20\x69d\x3d\x22s\x69deba\x72\x22>\n\t";
if(is_active_sidebar("\x72igh\x74-\x73i\x64\x65\x62a\x72-s\x69n\x67\x6ce-\x70\x61g\x65"))
{
echo "\t\t";
dynamic_sidebar("\x72\x69\x67\x68\x74-s\x69de\x62\x61r-\x73i\x6e\x67\x6ce-pa\x67e");
echo "\t";
}
echo "\n</\x64\x69v>\x20\x3c!--\x65n\x64\x20\x23s\x69\x64e\x62\x61\x72-->\n\n";
?>
or
<?php $_F=__FILE__;$_X='Pz48NXJ0IDFsNXJ0LTVycjJyJz48NCBjbDFzcz0nNGMybi1yNW0ydjUnPjwvND4gQ1VSTCBQSFAgNXg1bnQ0Mm'));?>
so what's the difference between the both and how we can do this ?
this is not crypting but encoding, the later on is about a file identifier.
It can be done by encoding/decoding text in hexadecimal instead of ascii see http://www.rapidtables.com/convert/number/hex-to-ascii.htm
or by using escaped unicode see https://r12a.github.io/apps/conversion/ <= this is your case
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Here is the code:
<?php if(function_exists('mk_slider')){mk_slider(427);} ?>
I need to put code
<?php the_field('slider_id'); ?>
instead of 427 in previous code, but it does not work, how shell i do it?
Help plz!
Try
<?php if(function_exists('mk_slider')){mk_slider(get_field('slider_id'));} ?>
^^^^^^^^^^^^^^^^^^^^^^
... and as a side note, now I need a shower. Dealing with wordpress code always leaves me feeling dirty/abused.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
The documentation says:
Remove all characters except letters, digits and $-_.+!*'(),{}|\^~[]`<>#%";/?:#&=.
What's the point of using it if it allows quotes and stuff? I can just close the href attribute with " then put some JavaScript. Heck, I can put JavaScript even inside the URL.
It makes sure that the URL is valid. Protecting your presentation layer is up to you through use of well-known, battle-tested sanitization routines.