Jump to content

hash1

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

hash1's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, im wanting to create some sort of invite code script where I can generate a handful of active codes and then give them out so that who ever receives them can use them to sign up at my website. Does any one know how I would go about doing this? Im absolutely clueless.
  2. What im trying to do is make this into an if else statement so that if the "URL" is equal to the "http://www.someurl.com/" below then it echos the array like it already does. I want the else statement to just echo something like the file_get_contents array but minus the $category and $slug variables and also to have the url be dynamic so the original url can be any and not just a "set" url. Or just have the below array be able to have any link instead of the set one. I hope im explaining this right if not I apologize and can go into further detail. <?php $post_id = get_post($post->ID); // get current post or page $slug = $post_id->post_name; // define slug as $slug $category = get_the_category($cat_name); echo file_get_contents('http://www.someurl.com/' . $category . '/watch-' . $slug . '.html?share=embed'); ?> Is there a way to do this? I've been stuck on this for awhile now, any help is greatly appreciated! Thanks
  3. Im a little stuck with an CPA affiliate script im working on. Im trying to figure out how I would be able to track if a member of the site has completed a offer? Thanks!
  4. Thank you I will keep that in mind! And to answer asmith, I just get a white page and then it redirects to the host companies page?
  5. I tried throwing in header right after the two session lines, but this made the script sop functioning. And here is my handler which is where session_start is 1. <?php 2. session_start(); 3. mysql_connect("**********", "**********", "**********"); 4. mysql_select_db("**********_usys"); 5. function cleanString($string){ 6. htmlentities(mysql_real_escape_string($string)); 7. return $string; 8. } 9. if(!$_SESSION['username'] || !$_SESSION['password']){ 10. $loggedIn = False; 11. } else { 12. $loggedIn = True; 13. } 14. ?>
  6. Hey guys stumped again here. Im trying to get this to redirect to the members page after it has verified all credentials and then started the users session. Here is what the code looks like <?php require_once 'handler.php'; $username = cleanString($_POST['username']); $password = md5($_POST['password']); if(empty($username) || empty($password)){ echo 'You must enter a username and password!'; } else{ $sql = mysql_query("SELECT * FROM users WHERE username='$username'"); if(mysql_num_rows($sql) < 1){ echo 'That username does not exist.'; } else{ $sql2 = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'"); if(mysql_num_rows($sql2) < 1){ echo 'Your password is incorrect.'; } else{ $_SESSION['username'] = $username; $_SESSION['password'] = $password; } } } ?> I tried throwing header("Location: http://phpproject.netii.net/members.php"); in the bunch, but that didn't work out very well. Thanks in advanced!
  7. Hello everyone, recently I have been trying to figure out how I can create a script to work with my affiliates CPA offers some what like an incentive site. In fact they have info on the post back and what not here This feature allows you to receive instant notice of every lead that credits to your account. We will post information to the URL(s) that you provide via GET variables. For example, if your postback URL is http://yoursite.com/postback.php we will post the information in the following format: http://yoursite.com/postback.php?campid=xxx&name=xxx&rate=xxx&sid=xxx&status=xxx Explanation of postback variables: Variable Description campid ID number of the campaign credited sid The SubID that was passed in the campaign link rate Commission earned (Will be negative if status is revoked) status Status of the lead. 1 for payable, 2 for revoked name Name of the campaign All postbacks will originate from one of the following IP addresses: 72.52.163.143 72.52.163.144 You should configure your script to only accept postbacks from these IPs. If your server is down, or the postback otherwise fails, we will retry every two hours, up to ten times. If every attempt fails, you'll receive an email notice. You may have all of your lead notices post to a single URL, or you may use different postback URLs depending on the SubID of the lead. To use a postback URL for all leads, leave the Prefix field blank. If you only want leads with a certain prefix to be posted to a URL, enter the prefix, such as "SITE2-". You can enter a URL more than once, to provide more than one prefix to use. But so far from what I have been reading you can't accomplish post backs with php. Any suggestions are greatly appreciated.
  8. Hey guys im working on a script and when ever I try to login it is shooting up an error but the username/password are in fact correct. <? if(isset($_POST['submit'])){ require('config.inc.php'); require('functions.inc.php'); $email = $_POST['email']; $pass = $_POST['pass']; $errors = array(); if($email == ""){ $errors[] = "You forgot to enter a email"; } else{ $email = mysql_real_escape_string($email); } if($pass == "") { $errors[] = "You forgot to enter a password"; } else{ $pass = mysql_real_escape_string($pass); } if(empty($errors)){ $id = check_login($email,$pass,$siteid); if($id['login'] == 0){ $errors[] = "The email and password combination is incorrect"; } if($id['login'] == 2){ $errors[] = "You have been banned from this site, please contact support if you have any question"; } } if ($id['login'] == 1){ session_start(); $_SESSION['userid'] = $id['userid']; header("Location:members.php"); exit(); } } ?> <? include('header.php') ?> <div id="content_main"> <h3>Login</h3> <? if(!empty($errors)){ echo '<p class="error"><ul>'; foreach($errors as $msg) echo "<li> $msg </li>\n"; echo '</ul></p>'; } if($_GET["new"]) echo "Your account has been sucessfully created!"; ?> <? include('login.html'); ?> </div> </div> <? include ('footer.php'); ?> Im really stumped on this one, I hope I presented the question in the right way. Thanks in advanced
  9. Hey guys im working on my first script that will actually be useful to people, however im wondering how I can only allow users to upload the following file formats: .zip, .rar, and .7zip Here is the code that takes care of that, but I feel I have done it incorrectly. if ((($_FILES["file"]["type"] == ".zip") || ($_FILES["file"]["type"] == ".rar") || ($_FILES["file"]["type"] == ".7zip")) && ($_FILES["file"]["size"] < 20000)) { I also want to change the maximum file size to something in the MB range instead of 20 kilobytes also but am unsure how to. Thanks!
  10. Thanks! Worked perfectly im going to have to further explore strtolower().
  11. Hey guys im just fooling around with a little project to better my self in php. Im trying to add two variable to the below code for an if else statement you can see below. if($name == "Ian") Instead of just having if $name equals Ian I want it to also be equal to "ian" a lower case version. How can I accomplish this? Whole code <?php $name = $_GET["fname"]; $hobby = $_GET["hobby"]; if($name == "Ian") echo "Hello Ean, you are the greatest!"; else { echo "Hello, <b>$name!</b><br />"; echo "Your hobby is $hobby ? Hmm you sound like a loser....."; } ?> Thank you!
  12. Practice. Yes but im asking how I should practice? And what is good to practice with at my experience level?
  13. I apologize if this is the wrong section. Im wondering where is a good place to start or continue for some one is intermediate in php. I scored 100% on the w3schools php quiz! I want to start making scripts, I have made a bunch of small boring ones. So I guess what im asking is what should a intermediate php coder do to get better.
  14. Could you tell me how to do this please some thing said to look in php.ini to enable it but i didnt find anything like that in the php.ini
  15. I suppose send info to db or something Im not sure honestly its when I try to register to my site so that im a member
×
×
  • 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.