corbin
-
Posts
8,102 -
Joined
-
Last visited
Posts posted by corbin
-
-
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?
-
You need to make sure php is loading php_mssql.dll
-
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 -
Thanks. I'll try it :).
-
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.......
-
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...?
-
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 -
They match for me too...
-
Also you can use it like
if(condition == "something") { ?>
html code here
<? }
else { ?>
more html code
<? }
?> -
TopStyle Pro sounds pretty good, but 80 bucks :(.
-
hmmm try
if(($_POST['dname']) && ($_POST['dname'] != "")) { $_SESSION['contest'] = $_POST['dname']; }
else { //what to do if the post value isnt set. } -
I use notepad++... It can handle php, c++, java, HTML, and like 40 other things lol... It has no FTP functionality at all though... I use SmartFTP
-
I wrote my first script that involved sessions 2 days ago, so I'm far from a session expert, but you could just do
if(!$_SESSION['contest']) { $_SESSION['contest'] = $_POST['dname']; } -
In your first form try changing
$_SESSION['contest']=$_POST['dname'];
to $_SESSION['contest'] = "<name of a table you know exists>"; and see if the scripts after it work then. -
in the second form... or which ever one youre having trouble with, at the very top of the page try putting
session_start();
echo $_SESSION['contest'];
and see if it echos anything -
Oh, ignore my post... Lol i think redarrow is right...
-
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. -
you forgot session_start(); in your second file.
-
Dont some proxies send something about being a proxy in a header? I dont remember where i read that though so I'm probably wrong...
-
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"); ?> -
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] -
Oh, ok then yeah that works... the hidden fields... Lemme write a simple login script real quick and see if i can get it to do what you want...
-
Well what is making the URL?
-
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>
Parse asp
in Apache HTTP Server
Posted