Jump to content

tobes

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

About tobes

  • Birthday 12/31/1988

Contact Methods

  • Website URL
    http://www.myspace.com/murh

Profile Information

  • Gender
    Male
  • Location
    NH

tobes's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. If you want to use a form with multiple checkboxes (e.g. one per row) and assign the same name to each checkbox then the name needs to end with []. This tells PHP to put all checked values into an array variable. For example: <input type="checkbox" name="id[]" value="value_1"> <input type="checkbox" name="id[]" value="value_2"> .. <input type="checkbox" name="id[]" value="value_x"> You can now retrieve all values by using:   $values = $_POST['id']; If the name does not end with [], then only a single value will be available via the $_POST variable even if the user checks several checkboxes. Reference: http://us3.php.net/reserved.variables
  2. Hi guys. I have a little bit of a problem. I'm a design partner in a fairly popular Web Site in which people login with an ID number and refer new users for points. When a new user logs in for the first time, the person who referred them earns a set amount of points. This is how users are arranged. The more points you have, the closer to the top you appear. We've taken a few measures to prevent cheating such as keeping a cache of IPs and only awarding referral points if the ID originates from an IP that's unique to the cache. Of course, an obvious way around that is to consistently hide behind different anonymous/elite proxies and refer random IDs from your own machine. I know of other sites with themes similar to ours that prevent this method of cheating. Does anyone have any suggestions? I guess what I'm trying to ask is if it's possible to uniquely identify a user's computer even if they've decided to hide their IP behind a proxy? Any help is appreciated. Thanks.
  3. Is it safe to hash the password and compare it to the hash of the actual password before allowing access to the script? Something like this? loginform.html [code] <form method="post" action="checkpassword.php"> <input type="password" name="password"> <input type="submit" value="Enter"> </form> [/code] checkpassword.php [code] <?php $hash = md5($_POST['password']); if ($hash = "md5_of_the_actual_password") { //proceed with contents of script here } else { echo "Sorry. Wrong password.<br><a href="loginform.html">Go back.</a>"; } ?> [/code]
  4. [!--quoteo(post=385406:date=Jun 18 2006, 04:04 PM:name=SemiApocalyptic)--][div class=\'quotetop\']QUOTE(SemiApocalyptic @ Jun 18 2006, 04:04 PM) [snapback]385406[/snapback][/div][div class=\'quotemain\'][!--quotec--] I think it's possible to do this with cURL (libcurl) and PHP. Search Google for "cURL tutorial" the official site should be at the top, or check out the curl functions in the PHP manual (I think there's some in there) [/quote] Thanks much for the quick reply. I will check that out. --Toby EDIT: I just wanted to say thanks for the kick in the right direction. I found everything I needed as you suggested. Thanks again.
  5. Hello. I'm working on a PHP project and I want it to accomplish the following tasks: 1. A user copies and pastes a URL into a form and submits it. 2. The PHP code validates the URL based on preset credentials and proceeds to grab the page contents of the URL. 3. If the URL and the contents pass set critera, the PHP code then grabs and stores certain elements of the page into a file. I've got most of it done. I'm experienced with PHP and it should work fine. The only problem is that the URLs that are submitted into the form require preauthorization for their contents to be extracted, otherwise get_file_contents just returns the login page. Now, I do have a username and password for the site the submitted URLs are hosted on, and I can easily grab the contents of the pages manually (if I sign in and navigate to them), but I would love for it to be done automatically. Is there anyway this can be done? This is the code of my page with the form on it that users enter the URL in: [code]<form method="post" action="checkproof.php"> <font face="verdana" size="3"> Proof URL: <input type="text" name="proofurl" size="100"> </font> <br><br> <input type="submit" value=" - - - Check my proof! - - - "> </form>[/code] This is the beginning of the code for checkproof.php that fails: [code] <?php $proofurl = $_POST["proofurl"]; $urlcontents = file_get_contents($proofurl); ?>[/code] Instead of containing the content of $proofurl, $urlcontents ends up containing the main site sign in form page (several elements of which I have removed). [code] <form action="[CFN Validation Location]" method="post" name="..." id="..."> <input type="hidden" name="NextPage" value="..."> <input type="text" name="email" size="20"> <input type="password" name="password" size="20"> <input type="image" src="..." id="..." name="..." onclick="return doSubmit();"> </form> [/code] Is it possible to use PHP to login to this form with my e-mail and password before calling on $urlcontents allowing access to the page contents? 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.