Author |
Message |
MrTerry
Joined: 26 Jan 2010 Posts: 34
|
|
|
|
hi everybody
i m new to php so it is quite a challenge for me ... all i get is "error" XD
i made a site which creates a text file whenever my url is opened with a set parameter
if get parameter is used my code searchs for a file with this name in my webspace
but it seems this challenge doesnt even tries to set or get ..... firebug doesnt seem to give me a clue
is there a tool which can show me which actions were tried?
thx
Terry
|
|
Fri Feb 05, 2010 3:46 pm |
|
 |
michuber
Joined: 26 Oct 2008 Posts: 57
|
|
|
|
 |
 |
is there a tool which can show me which actions were tried? |
You should take a look at your server's access and error log.
|
|
Fri Feb 05, 2010 10:13 pm |
|
 |
markobr
Joined: 20 May 2010 Posts: 17 Location: Tübingen |
|
|
|
Yep, to me it sends 8 requests and accepts answers in text/plain.
And just a remark from the nitpicker in me: What I write to solve this is technically not a "server" (which would listen on a port) but a CGI script (which is called by the webserver already in place).
|
|
Tue Jun 15, 2010 9:53 pm |
|
 |
skooli
Joined: 16 Oct 2010 Posts: 2
|
|
|
|
For clarification: you have to remember ALL set values, not just the last one.
|
|
Sun Oct 17, 2010 11:14 am |
|
 |
AMindForeverVoyaging
Forum Admin
Joined: 28 May 2011 Posts: 493 Location: Germany |
|
|
Tue Jul 26, 2011 6:23 am |
|
 |
bsguedes

Joined: 24 Feb 2009 Posts: 103 Location: Porto Alegre |
|
|
|
I'm still stuck in this challenge, even having a script working correctly with manual testing.
I know almost nothing of PHP, does a simple " echo 'yes'; " or " echo 'no' " work to return the answer asked by the challenge ?
Would someone who solved the challenge be kind enough to test my URL if I send it via PM?
Thanks.
|
|
Tue Jul 26, 2011 7:15 pm |
|
 |
AMindForeverVoyaging
Forum Admin
Joined: 28 May 2011 Posts: 493 Location: Germany |
|
|
|
Do you have your page hosted by a provider who allows access to the server logs? Because mine does not, at least not for free accounts. I think that this could help in finding out where things are going wrong.
|
|
Tue Jul 26, 2011 7:28 pm |
|
 |
rmplpmpl
Joined: 26 Oct 2008 Posts: 113 Location: Germany |
|
|
|
 |
 |
I'm still stuck in this challenge, even having a script working correctly with manual testing.
I know almost nothing of PHP, does a simple " echo 'yes'; " or " echo 'no' " work to return the answer asked by the challenge ?
Would someone who solved the challenge be kind enough to test my URL if I send it via PM?
Thanks. |
this should to the trick. you can PM me your URL (going to bed now, though)
|
|
Tue Jul 26, 2011 9:22 pm |
|
 |
megabreit
Joined: 03 Jan 2009 Posts: 141
|
|
|
|
In many challenges a source of pain: Did you check your output for "hidden" characters like "carriage return" or "line feed"?
|
|
Wed Jul 27, 2011 12:51 pm |
|
 |
AMindForeverVoyaging
Forum Admin
Joined: 28 May 2011 Posts: 493 Location: Germany |
|
|
|
 |
 |
In many challenges a source of pain: Did you check your output for "hidden" characters like "carriage return" or "line feed"? |
Hm, while you are in general right about this being a thing to consider, I don't see how something like:
 |
 |
<?php
$answer = "megabreit";
print $answer;
?>
|
could generate unwanted characters at the end of the output, that is after the "t" in this example?
|
|
Wed Jul 27, 2011 1:35 pm |
|
 |
CodeX

Joined: 17 Oct 2008 Posts: 350
|
|
|
|
if you look at your page through something like CURL you will be able to see every byte of output, you will probably see an newline thanks to Apache/Zend being kind enough to throw in a newline at the end, I think there is a way around this that doesn't involve modifying settings
|
|
Wed Jul 27, 2011 2:06 pm |
|
 |
AMindForeverVoyaging
Forum Admin
Joined: 28 May 2011 Posts: 493 Location: Germany |
|
|
|
Does that mean that the webserver could deliver a newline, but the browser would not display it? Fantastic. 
|
|
Wed Jul 27, 2011 2:26 pm |
|
 |
rmplpmpl
Joined: 26 Oct 2008 Posts: 113 Location: Germany |
|
|
|
 |
 |
In many challenges a source of pain: Did you check your output for "hidden" characters like "carriage return" or "line feed"? |
Exactly this seems to be the problem of bsguedes. It was "visible" in the browser as well.
edit: i just remembered that this seems to be another difference when using echo instead of print, which is pretty odd
|
|
Wed Jul 27, 2011 3:08 pm |
|
 |
AMindForeverVoyaging
Forum Admin
Joined: 28 May 2011 Posts: 493 Location: Germany |
|
|
|
 |
 |
Exactly this seems to be the problem of bsguedes. It was "visible" in the browser as well.
edit: i just remembered that this seems to be another difference when using echo instead of print, which is pretty odd |
On my machine, I see no difference between:
 |
 |
<?php
echo "yes";
?>
|
and
 |
 |
<?php
print "yes";
?>
|
when saving the pages to hard disk and comparing them. Also "View Page Source" within the browser does not show any Carriage Return/Line Feed or other superfluous characters. This is on Windows XP SP3, Apache 2.2.19, PHP 5.2.17, Mozilla Firefox 3.6.18.
Now if this were platform dependent or version dependent, that would make it even worse.
|
|
Wed Jul 27, 2011 3:35 pm |
|
 |
CodeX

Joined: 17 Oct 2008 Posts: 350
|
|
|
|
If I recall you can avoid the additional newline by leaving off the closing PHP tag, I think that was the reason why the Expression Engine extensions rules state you must leave off the closing tag for extensions as the newline can cause problems when it is imported. I would still suggest you check out your pages output using something like CURL to show the response quite literally byte for byte as I remember Firefox doing stuff where newlines and maybe tabs/white space were concerned. I don't know about it's normal operation with newlines but I read on php.net that print has/does return(ed/s) a newline character if it is given a null string so may be appending a newline onto text anyway.
All that aside you should be able to manage it in the end as I did it with PHP some time ago although I appreciate config may be different but it shouldn't be too much of a problem if you a thorough.
|
|
Wed Jul 27, 2011 4:17 pm |
|
 |
|