logs archiveIRC Archive / Freenode / #php / 2015 / August / 16 / 1
adamculp
__adrian: Thanks. Nice solution.
Alphos
__adrian unless /*bad*/ is replaced with ?><script type="text/javascript>while(1) { alert("kindly don't do that."); }</script><?php
__adrian : trust me, that'll teach 'em :p
bruteforce defense <3 :D
runinsquares
while(1) { confirm('have you learnt your lesson?'); }
__adrian
Alphos lol
start hitting $_SERVER["REMOTE_ADDR"] while you're at it
adamculp
Casting to (int) kinda solves it if an int is to be expected.
__adrian
adamculp, this is not a solution.
http://ctype_digit + previous suggestion
http://php.net/ctype_digit
do you follow what realpath does?
and what the comparison accomplishes?
Bruce_Dev
Basically I'm new to developing and trying to get some experience. I rewrote a bit of an in developed minecraft api in php that was on github, I wanted to know if somebody could take a quick look (app/index.php) and compare it to the original repo?
https://github.com/BruceDev/MinecraftProfile
adamculp
Thanks __adrian
__adrian
np
         

k_j
i am using a php based website. it allows you to write articles by just inserting the text and clicking submit. however every url i put in the text is transformed in a url with an anchor in the final html page. is there a way to escape this behaviour and have the website just write an url as simple text without anchors?
joeyjones
k_j: you will want to talk to the developer of the website as php is just the language used to create it and does not correlate to the final result of your website.
k_j
joeyjones, inoticed that the php interpets html tags
i wonder if it exists a tag for doind what i want
joeyjones
php does not interpret html tags.
Majeh
how does php interpret html tags?
joeyjones
php is simply a programming language. you're wasting your time here, go and contact the developer of the site.
Bruce_Dev
joeyjones
I mean
joeyjones
Bruce_Dev: Yes?
Bruce_Dev
I read wrong so nevermind
joeyjones
No problem. Just checking in since I was pinged.
Bruce_Dev
yep :)
rach23py
is it possible for two php links to refer each other?
joeyjones
rach23py: What do you mean by php links?
Majeh
rach23py what is a php link you're talking about?
rach23py
the index.php of a website is a link, then inside that page it refers to another link now is html.
Majeh
how does it "refer" to it?
rach23py
is it possible to make the .html into a php link, like the index.php file
Majeh
is it including it, is it providing a hyperlink..
rach23py
providing a hyperlink
Majeh
so where's the problem? are you asking whether 2 php files can provide a hyperlink to each other?
         

rach23py
yes,
Majeh
they can
joeyjones
OMG
rach23py
i was trying to convert 2 html page into 2 php page, the index.html is easy, what can I do to convert the other page into .php page?
ldc
s/html/php
joeyjones
rach23py: you should really look at an intro to HTML
rach23py
any more specific advice?
Majeh
your question makes no sense because there's terminology gap here. i for sure have no clue what you're asking really and what you're converting or why
a .php script usually produces html
so if something is .html or .php, if you load that in your browser - it's irrelevant what's behind the scenes, browser receives html
therefore, "converting" - what are you converting and why? we don't know what converting means to you
rach23py
just curious, whether it is possible to convert simple html site into a php site.
Majeh
it is possible
everything is possible
your question is just too ambiguous
joeyjones
rach23py: You really need to get a solid foundation in HTML and then look at some PHP tutorials/courses.
rach23py: https://www.codecademy.com has some good free courses.
(Disclaimer: I did their Ruby course and found it fantastic but have not done their HTML or PHP courses.)
rach23py
okay, let me try again, does can I turn a html web address into dynamic type of address?
joeyjones
That question makes absolutely no sense at all...
*made
RobFWC
Do you want to run PHP code out ofa .htm?
Oh im too late
You definitely can't do that
__adrian
do what? name a file something.htm and execute it as php?
RobFWC
Unless you call a PHP page from javascript
Through AJAX
__adrian
that's a separate question
RobFWC
rach23py asked if they could turn a "html web address" into a dynamic "type of address"
which surely can only mean they want to execute server-side code but they don't want to change the existing URL
__adrian
yeah.. i realized i probably walked into the middle of something.
sorry.
RobFWC
Oh it was like 40 minutes ago I just didn't see it pop up
Alphos
[00:28:42] <RobFWC> You definitely can't do that /// sure you can. just need to configure your server to let php handle files with the .html extension
RobFWC
Interesting, didn't know that
Perhaps "definitely" was jumping the gun
It's certainly not default behaviour though
__adrian
no.
but you can handle URLs however you like
Alphos
RobFWC alternatively, you can let a php resource handler handle every request to every path on your server
that's a lot more used
RobFWC
perhaps .htaccess could redirect old htm links to a new resource-handling PHP page?
__adrian
i still don't know what the original question was, but old URLs ’ new URLs is probably better handled by mod_rewrite.
if apache (or whatever server you use) can do {x}, then it's probably faster than making php do it.
Alphos
no point in guessing, i believe he didn't really know what he was doing at all
__adrian
BTW htaccess is horrible performance; use the apache (vhost) config instead. turn htaccess off.
RobFWC
How does it work compared to htaccess?
__adrian
same way
RobFWC
Can I still use regex to mod URLs or
__adrian
htaccess files are just an override mechanism
RobFWC
Ah
Alphos
additionally, a vhost file is read once. an htaccess, at every request
a vhost is centralized, an htaccess isn't
RobFWC
Dynamics tho :P
Alphos
a vhost is always activated, an htaccess isn't, depending on server config
RobFWC
(kidding)
__adrian
yeah. but the big deal is that if allowoverride is on, apache LOOKS for htaccess files constantly
just looking for them is a fair performance hit
RobFWC
Can you call set_time_limit() inside a script to temporarily prolong exec time?
Like for that one script or will it reset an environment var
re-set*
« prev 1 2 3 4 5 6 7 8 9 10 next »