How to protect comments from being hacked [closed] - php

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
My code uses this:
Method - POST
fopen then fwrite then fclose which writes in comments.
HTML Then opens comments. HTML by
<?php
require 'comments.html';
?>

Don't use require(), as it will execute any PHP code in comments.html.
Use readfile() instead, which just copies the file to the output buffer.
http://php.net/manual/en/function.readfile.php

Related

is there a php code that include/require a page and not a file? (PHP) [closed]

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
I have a page 'Error 404' and the address is like http://myurl.com/error404
the php file of error404 require's the index.php to properly show it.
I need a php code that will load or show the content in the url above without redirecting/changing the url. thanks
echo file_get_contents("http://myurl.com/error404");
Works also for URLs.
DOCS

Opening an pdf file without print and save buttons - php [closed]

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 want pdf view in browser but user cannot download, save or print that file. I don't want to use build-in of browser. I want it in php or jquery, js..
This is not possible. All files reside on the client machine the user can do what they like with them.

Put PHP code in existing PHP code [closed]

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.

What is the proper way of inserting an html file template in a php email [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is the proper way of inserting an html file template in a php email
ob_start();
include("example.html");
$html = ob_get_clean();
or
file_get_contents();
im not sure how to use this
Highly depends on what example.html is doing. If it is just plain html both ways work the same.
With include you have variables you define earlier available in example.html.

simple php include single htm file safety [closed]

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 9 years ago.
Improve this question
I use this in htm file to include another htm file
<?php include("media/android.htm"); ?>
Is this safe?
Both of them are simple htm file with text and pictures.
Yes, it's completely safe. That's how PHP works.
But, keep in mind that's a php file, not html.
use jquery to load a file
$("#div1").load("media/android.htm");
Try this
include file without php

Categories