Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Http PHP page (return problem)  (Read 4302 times)

0 Members and 1 Guest are viewing this topic.

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
Http PHP page (return problem)
« 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?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Http PHP page (return problem)
« Reply #1 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!
SFML / OS X developer

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
Http PHP page (return problem)
« Reply #2 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.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Http PHP page (return problem)
« Reply #3 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.
SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Http PHP page (return problem)
« Reply #4 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?
Laurent Gomila - SFML developer

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
Http PHP page (return problem)
« Reply #5 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.

Spodi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://www.netgore.com/
Http PHP page (return problem)
« Reply #6 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.

 

anything