Jump to content

php new bie

Members
  • Posts

    31
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

php new bie's Achievements

Member

Member (2/5)

0

Reputation

  1. AbraCadaver , it works , Thank you very very much
  2. hello, I write a script using http_post_fields , the script work on my local host using easyphp .. When I upload it to my host service , it gives me an error to undefined function http_post_fields .. OK I know the problem ! the pecl_http extension not installed , So I contact my service provider and there is no replay .. my Q : any alternative function or code similar to http_post_fields thanks
  3. hello, The problem in short .. I googled and read almost all phpfreaks help threads and try manually evreything and I failed ! I have 2 sites A and B , What i want to make user login from site A into B using curl and thats OK. After logining in the page redirect the user to next page depending on the session generated by site b like this ASP.NET_SessionId=XXXXXXXXXXXX; path=/; HttpOnly now ! it says your session has been expired -> Re-login what I do is : function login($username,$pass){ /* STEP 1. let’s create a cookie file */ $cookie_jar = tempnam('./ses/','cookie'); /* STEP 2. visit the homepage to set the cookie properly */ $ch = curl_init ("http://siteB"); curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie_jar); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $source = curl_exec ($ch); $data = array('Username' => $username, 'Password' => $pass); $ch = curl_init ("http://SiteB_POST_PAGE"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt ($ch, CURLOPT_COOKIEFILE, "$cookie_jar"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $source = curl_exec ($ch); curl_close($ch); return $source; } echo login("name","pass"); I go to session folder and i see the generated file,every time i refresh the page a new file.tmp created with content : # Netscape HTTP Cookie File # http://curlm.haxx.se/rfc/cookie_spec.html # This file was generated by libcurl! Edit at your own risk. siteB FALSE / FALSE 0 ASP.NET_SessionId XXXXXXXXXXXXXXX . thats mean that cookies are properly stored but when login the login success and upon redirecting it says session has been expired, How can i save session to be used again and again !
  4. Maq, I used Nightslyr's suggestion and it works like a knife in butter xD thank you again and thanks to all. by the way this is a Demo not the real script because the real one is Messy and I need this function in the code so I write this simple one to be more easier to all to understand the problem exactly
  5. thanks, when I place $rand in switch function all done .. but what about this if I want the $match in switch function .. is that logically error ? !
  6. This code makes me crazy ??? why the numbers won't work properly when matched !! <?php $rand = rand(1,5); $num = array(0,1,2,3,4,5); $match = "" ; echo "<PRE>"; print_r($num); echo "</PRE>"; echo "rand = ". $rand . "<br />"; switch ($match){ case ($rand == $num['1'] ): $match = "PRE"; echo $match; break; case ($rand == $num['2']): $match = "1st"; echo $match; break; case ($rand == $num['3'] ): $match = "2nd"; echo $match; break; case ($rand == $num['4']): $match = "3rd"; echo $match; break; case ($rand == $num['5']): $match = "4th"; echo $match; break; default : $match = "NAH!"; break; } ?>
  7. hi, It may be a noob Q, but I'll appreciate any help :-) www.example.com is a remote host that uses ASP applications and java scripts and window's frames. So I need to get some data from these systems using file_get_contents function but the site depends on session . Any way to make a connection to the remote host and retrieve the generated session and use it through my code, then close the connection when the page completely loaded and if reloaded .. the cycle repeated by getting the new session and so on !
  8. yes ken , sure updating site policy will be changed thats if i found any solution. lol, i don't say two ppl using the same pc is abuse.I said based on the harm and abuse they do , if i start new topic in any boatd and have 2 accounts and then start to use the both in same thread and replying on my self and some of that infant mind do !! banning based on that you're sure that these accounts from the same PC and have some kind of similar pc info. and about schools , sure any webmaster will take that in his consideration
  9. thats based on abuse, i just want to discover that so i start this topic then baning their accounts based on the harm or abuse they do.
  10. simple modem restart and user agent switcher plugin in FF can override this . yes i googled and got that php is a server side lang .. Nope! PHP resides in the server so even if you could get those, you'll be getting the specs of your server hard drive, MAC address etc. If you want that to grab the user's computer specs, I find that very invasive. I probably would avoid your site. ken, any website is based on TRUST between the web application and returning visitors .. some ppl you need to ban them and they are just annoying u change their ips .. user agents have tons of membership ? so what can you do if you were me ! i need to improve my system to raise the security and privacy and ensure there is only one member has one account !
  11. i don't need a hard serial number as it.. i need something specific and unique for each user other than supplied by $_SERVER variable so what can i do with this ? the value will be encrypted and placen in cookies to be checked each visit also to detect cheating users ..
  12. i'm sorry if i don't clarify what i want .. so, i know this variable and use it ... and get information ... this step DONE ! now any other methods to get information like .. hard drive serial .. MAC address , computer name .. etc (another type of information not in the variable $_SERVER ) .. something more specific and unique to each user
  13. thanks, i know this .. i just ask if there is any other php methods to gather information like this to get more info
  14. hello, a noob Q but i appreciate anyone help me i wondered which info can PHP get from user .. i figured out those of global variable $_SERVER like .. IP adress , Remote host name ,useragent .. etc so what can i get also from php if i want to improve the log and cookie system of any web application thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.