Jump to content

corbin

Staff Alumni
  • Posts

    8,102
  • Joined

  • Last visited

Posts posted by corbin

  1. Well, I would like to be able to have apache parse ASP files, but I just cant figure out how to do it.  Ive followed random guides off google and found some module on apache.org but I cant get anything to work... I have apache 2.2... Any help would be appreciated.
  2. I installed MSSQL ( 2005 Express ) earlier.  Right now the service is running with no errors.  The port it listens on is still the default and I havent messed with any settings, but my computer wont answer port 1433.  Anyone know what could be causing this?
  3. Downloaded it and installed it, but i have something setup wrong i guess. When ever I try to use

    [code]
    <?
    $to = '<me>@hotmail.com';
    $subject = 'test';
    $message = 'test';
    $headers = "From: \r\n" .
          'X-Mailer: PHP/' . phpversion() . "\r\n" .
          "MIME-Version: 1.0\r\n" .
          "Content-Type: text/html; charset=utf-8\r\n" .
          "Content-Transfer-Encoding: 8bit\r\n\r\n";

    // Send
    mail($to, $subject, $message, $headers);
    ?>
    [/code]

    I get the error message
    Warning: mail() [function.mail]: SMTP server response: 550 550 Delivery is not allowed to this address. in Y:\public_html\common\mail.php on line 12
  4. Uhhhh, what you said makes no sense... All I'm asking is what is a decent mail server for windows... At the moment I'm messin with IIS's SMTP thing, but I dont like it very much.......
  5. Im about 90% sure this is in the wrong section, but I didnt know where else to put it :(.  Anyways can someone tell me of a free mail server thatll run on windows, and has a decent amount of features...?
  6. Gah! I know something I'm doing is wrong... I just dont know what.  My PHP wont recognize the funtion imageCreateTrueColor...  Can someone tell me why...  The script I'm using right now is just copied and pasted from php.net while im tryin to get this to work......

    [code]<?php
    header ("Content-type: image/png");
    $im = @imagecreatetruecolor(50, 100)
         or die("Cannot Initialize new GD image stream");
    $text_color = imagecolorallocate($im, 233, 14, 91);
    imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);
    imagepng($im);
    imagedestroy($im);
    ?> [/code]

    edit:  Forgot to say Apache 2.0.58 PHP 5.1.1
  7. variables with [''] in mysql queries I always try to avoid... Try something like

    $result=mysql_query("SELECT * FROM ".$prefix."contests WHERE name='contest'") or die(query_error());

    oh and if all else fails try making it something like

    $contest = $_SESSION['contest'];
    $q = ("SELECT * FROM ".$prefix."contests WHERE name='contest'");
    echo $q;
    $result = mysql_query($q);
    and see what it says $q is.
  8. No, but if you ever wanted to expand past just that one file at the end and possibly protect multiple files you could just make a file named "auth.php" or something like that with:
    [code]
    <?
    session_start();

    if($_SESSION['authed'] == "yes") { }
    if($_SESSION['authed'] != "yes") { header('Location: login.php?ref=forced'); }
    ?>
    [/code]

    and on the page youre tryin to protect just put <? include("auth.php"); ?>
  9. with change db.php to your include files name or change your include's name to db.php and try...

    [code]<?
    session_start();
    include("db.php");
    if(!$_SESSION['authed']) {
    if(($_COOKIE['cuser']) || ($_COOKIE['cpass'])) {
    $_SESSION['username'] = $_COOKIE['cuser'];
    $pass_md5 = $_COOKIE['cpass']; }
    if(($_POST['user_name']) || ($_POST['password'])) {
    $_SESSION['password'] = $_POST['password'];
    $_SESSION['username'] = $_POST['user_name'];
    }
    if($_SESSION['username']) { $username = $_SESSION['username']; }
    if($_SESSION['password']) { $password = $_SESSION['password']; }
    if(!$pass_md5) { $pass_md5 = md5($password); }
    if($_POST['sublogin']) { $sublogin = $_POST['sublogin']; }
    if($_POST['remember']) { $remember = $_POST['remember']; }
    $q = "SELECT * from accounts where (user_name = '$username') and (password = '$pass')"; //use $pass_md5 if the passwords in the db are encrypted with md5
    $r = mysql_num_rows(mysql_query($q));
    if($r > 0) {
    $_SESSION['authed'] = "yes";

    $success = "y";
    if($remember == "y") {
    setcookie("cuser", $username, time()+60*60*24*100);
    setcookie("cpass", $pass_md5, time()+60*60*24*100);
    }
    }
    }
    if($success) { echo "<meta http-equiv=\"Refresh\" content=\"0;url=$HTTP_SERVER_VARS[PHP_SELF]\">"; }
    echo "<center><h2>Login</h2>";
    if($_SESSION['authed']) { echo "You are now logged in."; }
    if($sublogin) {
    if($r < 1) { echo "Sorry, the username you entered does not exist or the password you input was incorrect.  Please try again."; }
    }
    if(!$_SESSION['authed']) { ?>
    <form method=POST action="login.php">
    Username: <input type="text" name="user_name"><br>
    Password: <input type="password" name="password"><br>
    <font size=2>Remember you?</font><input type="checkbox" name="remember" value="y" CHECKED><input type="submit" value="Login" name="sublogin" value="Login"><br>
    <? }
    ?>[/code]
  10. i would use a code like
    [code]if($_GET['act'] == "del"){

    $id = $_GET["id"];
        $query = mysql_query("DELETE FROM recent_match WHERE id='$id'") or die (mysql_error());

    if(!$query){
    echo '<font id=UserNameRed />There has been an error deleting the data. Please contact the webmaster.';
    }else{
    echo '<font id=UserNameRed />The data was deleted successfully.';
    }
    }[/code] and call to it with something like http://site.com/page.php?act=del&id=<what you want $id to be>
×
×
  • 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.