jdock1 Posted July 26, 2010 Share Posted July 26, 2010 I need to use my error message div within die()... but i dont know if I can do this.. Im not good with escaping with quatations for example, I got else { die ("Your ip has been blocked. Time till unblock:".($current_time - $blocked_time)); } I need to put a div in there for the error style: else { die ("<div class='error'>Your ip has been blocked. Time till unblock:".($current_time - $blocked_time));</div> } But I know that will just cause a bunch of errors. First of all is it even possible? Thanks for all the help I love this site. Its kind of embarassing the stupid shit I ask but Im just horrible with putting html into php. What confuses me is using double qoutes n single quotes and just quotes in general I just cant grasp it! Quote Link to comment https://forums.phpfreaks.com/topic/208963-is-it-possible-to-apply-css-within-die/ Share on other sites More sharing options...
sKunKbad Posted July 26, 2010 Share Posted July 26, 2010 I've used HTML inside of die() before, and inline CSS is just HTML, so it will work. I'm seeing that you are trying to block by IP, and while that is fairly useless, I think it is in your best interest if you don't output anything with die(), at least when dealing with people you are trying to block. Why let them know what is going on? Also, it would be better to block by IP inside your .htaccess, and then the user will get a forbidden message, and you won't have to style it. Quote Link to comment https://forums.phpfreaks.com/topic/208963-is-it-possible-to-apply-css-within-die/#findComment-1091468 Share on other sites More sharing options...
jdock1 Posted July 26, 2010 Author Share Posted July 26, 2010 I've used HTML inside of die() before, and inline CSS is just HTML, so it will work. I'm seeing that you are trying to block by IP, and while that is fairly useless, I think it is in your best interest if you don't output anything with die(), at least when dealing with people you are trying to block. Why let them know what is going on? Also, it would be better to block by IP inside your .htaccess, and then the user will get a forbidden message, and you won't have to style it. Well the way everything is set up I need to use die it makes it easier for me. This script resticts access to a page after being viewed 3 times... it saves the surfers IP in a database and matches it ...when the surfer gets the error message, it exits the script... im using an include file for the content on the page. Idk, it just makes it easier for me. But how would I apply the html in it? Like whats the structure of it? Thanks for your reply Quote Link to comment https://forums.phpfreaks.com/topic/208963-is-it-possible-to-apply-css-within-die/#findComment-1091473 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.