Jump to content

EdwinPaul

Members
  • Posts

    137
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Netherlands

EdwinPaul's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This code: $username_exist = mysql_num_rows($checkuser); if($username_exist > 0){ echo "I'm sorry but the username you specified has already been taken. Please pick another one."; unset($username); include '../register.html'; exit(); } should be: if(mysql_num_rows($checkuser) > 0){ echo "I'm sorry but the username you specified has already been taken. Please pick another one."; header('Location: register.html'); exit(); }
  2. Maybe batstanggt should also google 'sqlinjection' because this isn't safe. A username of 1' or '1=1 might give funny results...
  3. First of all, the sequence of all the actions in a program (or php-file) is important. For instance: you can't use a session-variable if you didn't fill it. And you can't use a variable in a SELECT if the contents isn't filled. Besides that, there are a few rules ordered by php and html. For instance: if you put something to the screen ( echo 'something') and after that you code your header of the html, you get an error-message: 'headers allready sent'. After you execute a query, the result comes in.. $result in your example. With this result you can fill an array of table-values with mysql_fetch_array($result). If you code: $row=mysql_fetch_array($result) then the array with the name $row is filled with keys (the names of your database-fields) an values (from the corresponding fields). You can acces them with $row['fieldname'] and do with it whatever you want, including putting it in a session-variable.
  4. ^^^ Inside a string it is not. $date = "$year-$month"; and $date = $year.'-'.$month; produce exactly the same result. Yes, I noticed. I removed it. :-\
  5. Why don't you echo some intermediate results? <?php $date = "$year-$month"; echo $date."<br/>"; echo date('Y-m',strtotime($date . '-1 -1 month'))."<br/>"; echo date('Y-m',strtotime($date . '-1 +1 month'))."<br/>"; ?>
  6. First of all: you cannot use if($post_username && $post_password) as if it were 2 booleans. They are NOT ! Second: <?php if (strlen($post_username) >25) || strlen($post_password) < 15)) ?> <?php if ( (strlen($post_username) >25) || (strlen($post_password) < 15) ) ?>
  7. Okay, too bad for your time spent. I copied your script to my server, changed the to-address, and now I think I can see what's wrong. Attachments are added to you message, and separated by boundaries. Those boundaries should be unique for each attachment. Therefor you added a variable in your script, called $num, and you -correctly- integrated this in you boundary. But you don't use and/or increment this, so al your boundaries have the same name. Furthermore: if you want to compose your own headers, each line you want to make should end with "\r\n" which means: 'go to the beginning of the next line'. http://php.net/manual/en/function.mail.php All-in-all I would strongly recommend to switch to using one of the mentioned EASY mailing-packages.
  8. According to the documentation, the syntax should be: What is the contents of your variables $file1 and $file2 ?
  9. Can you show the code where that happens?
  10. Lennart, to speed things up for yourself, consider using a package for sending mail: Libmail, PHPMailer, Swiftmail. And look at http://www.pfz.nl/forum/topic/455-s?do=findComment&comment=3247
  11. if ($insert_program) { if ($insert_audience) { are no booleans. If $_POST['audience'] is your checkbox, I think it would be wise to check it with isset($_POST['audience']) and with is_array($_POST['audience'])
  12. Another thing: some browsers do not send the contents of the submit-button whent the user hits enter, so it might be dangerous to test for the contents of that button. Also: $_REQUEST is an array which consists of everything in the $_GET, $_POST and $_COOKIE -arrays. You'd better check: if ($_SERVER['REQUEST_METHOD'] == "POST"){ in stead of if(isset($_REQUEST['submit'])) Also: try to find something on the internet about sql-injection. Your script is vulnerable! If I enter a user like 1' OR '1=1 with the same pasword, I can enter your site.
  13. If you remove the <div> </div> <p> and </p> from within your while-loop, things should go better. But really re-calculate the space !
×
×
  • 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.