Jump to content

whelpton

Members
  • Posts

    107
  • Joined

  • Last visited

Everything posted by whelpton

  1. Ok the code I am using so far is: <?php include 'config.php'; if(isset($_POST['submit'])) { $refer = addslashes(trim($_POST['refercode'])); $do0 = mysql_query("SELECT referused FROM Users WHERE id = '$refer'") or die(mysql_error()); $do = mysql_query("UPDATE Users SET referused = 1 WHERE id = '$refer' LIMIT 1") or die(mysql_error()); $do2 = mysql_query("UPDATE Users SET kquota = kquota + 50 WHERE id = '$refer' LIMIT 1") or die(mysql_error()); echo '<script>alert("Your friend has been informed that you have signed up with kopoloko! ");</script>'; ?><? } mysql_close($l); ?> I presume the problem I am having is with: $do0 = mysql_query("SELECT referused FROM Users WHERE id = '$refer'") or die(mysql_error()); Essentially, i want to check weather the referused = 1 and if it does, the script does not continue. Thanks for your help
  2. well then could you help me out and say what the right code is, I have no clue how to make a variable from a mysql database, Ive only started working with them this week .
  3. Ok the code I am using so far is: <?php include 'config.php'; if(isset($_POST['submit'])) { $refer = addslashes(trim($_POST['refercode'])); $do0 = mysql_query("SELECT referused FROM Users WHERE id = '$refer'") or die(mysql_error()); $do = mysql_query("UPDATE Users SET referused = 1 WHERE id = '$refer' LIMIT 1") or die(mysql_error()); $do2 = mysql_query("UPDATE Users SET kquota = kquota + 50 WHERE id = '$refer' LIMIT 1") or die(mysql_error()); echo '<script>alert("Your friend has been informed that you have signed up with kopoloko! ");</script>'; ?><? } mysql_close($l); ?> I presume the problem I am having is with: $do0 = mysql_query("SELECT referused FROM Users WHERE id = '$refer'") or die(mysql_error()); Essentially, i want to check weather the referused = 1 and if it does, the script does not continue. Thanks for your help
  4. Thanks dez, I can alter that to what I need
  5. I take it would be something along the lines of mysql_query("SELECT referused FROM Users WHERE id = '$refer'") or die(mysql_error()); but how do i stop the code from continueing if referused is 1?
  6. Ok, I need to check my mysql database to check if referused=1 and if it does the user cannot continue.
  7. I am currently using a mysql database to store my user data. I am trying to create a referal script that when a user refers a friend it increases his webspace ammount, I am a bit stumped on how to add a certain ammount to a mysql database. For example: $do = mysql_query("UPDATE Users SET kquota =? WHERE id = '$refer' LIMIT 1") or die(mysql_error()); I need the KQuota to increase by 50, I am a little confued on how to do this, I know how to change the ammount, but not add to it. Thanks for your time =)
  8. I was wondering how do I make php echo something when it encounters a ?= for example, if the page was test.php nothing would display, but if it was test.php?=deleted it would say something like your mail has been deleted
  9. Thanks ive got it now actually =)
  10. Cheers but I dont understand how to put that into the code that I am using already, im a real beginner to php
  11. Ok, I am using strings to display email contents, I was wondering if there's any way of making my subject string ($strSubject) only display a certain number of characters, for example 25, so that it dosnt break my table formatting. The code I am using is below. $arrMessage = $objPop3->getParsedHeaders($objPop3->numMsg()-$i); $strDate = $arrMessage['Delivery-date']; $strFrom = $arrMessage['From']; $strReplyTo = $arrMessage['Reply-To']; $strSubject = (strlen($arrMessage['Subject'])<1)?'(No Subject)':$arrMessage['Subject']; Thanks
  12. when I use any of these codes all i get is a similar error to: Warning: imap_check(): supplied argument is not a valid imap resource in /home/kopoloko/public_html/messages.php3 on line 8 does anyone know what this kindof error means?
  13. Im looking for a simple bit of code that can access e-mail for me, to provide my users with a webmail interface, but I cant seem to find any code that works or is simple enough for me to understand. can anyone help me with this please? Thank you
  14. Sorry im a newbie to php, just how would I Run it though the second function?
  15. Sorry about posting so much. I recently got the code to show how much space a folder is using: <?php $path = "gal"; echo "Folder $path = ".filesize_r($path)." bytes"; function filesize_r($path){ if(!file_exists($path)) return 0; if(is_file($path)) return filesize($path); $ret = 0; foreach(glob($path."/*") as $fn) $ret += filesize_r($fn); return $ret; } ?> Is there anyway to convert this to show MegaBytes instead of Bytes? Thanks
  16. thanks I got it actually, I didnt see the Echo at the top =)
  17. Thank you very much, just one more thing... is there anyway of making it not display "Folder ./test =" and just making it display the size of the folder
  18. Well, for my hosting site I really need to be able to tell my users how much space theyve got left. Is there anyway of using php to check how large a certain folder is?
  19. No, I decided that creating my own file manager was just too big a task, and I was right! The rest of the code is all mine though.
×
×
  • 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.