SFML community forums

Help => Network => Topic started by: mimipim on December 23, 2010, 10:46:57 pm

Title: Http PHP page (return problem)
Post by: mimipim on December 23, 2010, 10:46:57 pm
PHP code:
Code: [Select]
<?php
require_once&#40;"config.php"&#41;;
if&#40;login&#40;$name, $pw&#41;&#41; &#123;
echo "User&#58; $name\nPassword&#58; $pw";
&
#125; else echo 'You are not login! Please do it right now if you still want to live! &#58;@';
?>


In cpp code:
Code: [Select]
std::cout<<Response.GetBody()<<"\n\n";

Everything is cool and work but.... I don't recive $name and, $pw values and i think the reason is that i read them from cookies.

Is there any solutions or advices for me please?
Title: Http PHP page (return problem)
Post by: Hiura on December 23, 2010, 10:57:52 pm
If you need cookie, you'll need to implement them.  The RFC is http://www.ietf.org/rfc/rfc2109.txt Read ยง5 for examples.

Good luck!
Title: Http PHP page (return problem)
Post by: mimipim on December 23, 2010, 11:16:40 pm
Hiura, thanks for this link(information) but im not very good with English and that is a lot of english text for me.

I will be happy if you explane me with less words and write less code for examples.

Thanks.

Edit: All I need is to read and set cookies from my program.
Title: Http PHP page (return problem)
Post by: Hiura on December 23, 2010, 11:21:33 pm
well, I'm sorry but this is a HUGE thing! And I never used it before so I won't be able to help you. Sorry.
Title: Http PHP page (return problem)
Post by: Laurent on December 24, 2010, 09:06:02 am
What does the received body look like?

I don't think it's related to cookies, if the variables are properly initialized in your PHP script they should be outputed correctly.

Is there a difference if you use regular variables, with hard-coded values?
Title: Http PHP page (return problem)
Post by: mimipim on December 24, 2010, 09:51:33 am
Hiura, no problem.  :)

Laurent, I test it now and if I overwrite these variables in PHP they return that value that im put in them. But when read from cookies return NULL in variables.

PS: In browser works just in program don't read them.
Title: Http PHP page (return problem)
Post by: Spodi on December 24, 2010, 06:42:43 pm
Can always bust out good ol' Wireshark (or similar). With FireFox, you can also use the Tamper Data plugin also to see the messages going to/from the browser.