-
Posts
4,953 -
Joined
-
Last visited
Everything posted by darkfreaks
-
put the top part into your code it will make the checkboxes check
-
<?php while (list ($key,$val) = @each ($box)) { echo "$val,"; } ?> <input type=checkbox name=box[] value='Mathew'>
-
[SOLVED] Insert into SQL several items info
darkfreaks replied to miligraf's topic in PHP Coding Help
try doing ($title,$j) -
Try: <table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td><form action="" method="get"> <select name="menu1" onChange="MM_jumpMenu('parent',this,0)"> <option value="">Select Layout Type</option> <?php $fetch = mysql_query("SELECT * FROM layout_cats"); while( $row = mysql_fetch_array($fetch) ){ ?> <option value="<? echo ("$url"); ?>index.php?app=layouts&action=cats&id=<?=$row->id?>"><?=$row->name?></option> <?php } ?> </select> </form></td> </tr> </table> <?php $fetch = mysql_query("SELECT * FROM layout_cats WHERE id=$id ORDER BY id DESC"); $cat = mysql_fetch_array($fetch); $seo_title = $sitename." - ".$cat->name." Layouts"; ?> <h1><?=$cat->name?> Layouts</h1> <?php $fetch2 = mysql_query("SELECT * FROM layouts WHERE cat_id=$id AND published='1' ORDER BY id DESC"); while( $row = mysql_fetch_array($fetch2) ){ ?>
-
From what i saw your script was working correctly? what exactly do you mean it isnt adding up right? ???
-
i dont understand ???
-
imagecreatefrompng(captcha.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory on line 19 of captcha.php what exactly is wrong on this line? someone told me i need to change the path what path?
-
try: <?php $price= $_SESSION['price']; print_r ($price); ?>
-
ok what do i put for $captcha = imagecreatefrompng("captcha.png"); i have the background picture in the same folder. i dont see how the path could be wrong.
-
look it up on php.net
-
i pmed you on yahoo but no response
-
[SOLVED] login script doesnt work :(
darkfreaks replied to thewooleymammoth's topic in PHP Coding Help
Try: <?php $username="php"; $password="ironpass"; $database="userlist"; $table="login"; $connectmysql="mysql_connect(localhost,$username,$password)"; if (!isset($_POST['loggedin'])) { echo "<a>please log in[/url] <form method='post'> Username:<input type='text' name='username'> Password:<input type='text' name='password'> <input type='submit' name='loggedin' value='Log In'><a href='resister.php'>Register here[/url]"; }elseif{ (isset($_POST['loggedin'])) $user="$_POST['username']"; $userpass = "$_POST['password']"; $query1="SELECT*FROM login"; $query2="SELECT*FROM login WHERE username='$user'"; $query3="SELECT*FROM login WHERE username='$userpass'"; $result1="mysql_query($query1)"; $result2="mysql_query($query2)"; $result3="mysql_query($query3)"; $connectmysql mysql_select_db($database) or die("unable to select database"); if($user == $query2) { if($userpass == $query3) { echo "Thank you for logging in"; setcookie ["$user ","$userpass "]; } } } elseif($_COOKIE['user'] == $userpass) { echo "Welcome $user Enjoy the site"; } ?> -
Try: <?php require_once 'appinclude.php'; $con = mysql_connect("myhost","myaccount","mypassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mydatabase", $con); $result = mysql_query("SELECT * FROM members WHERE id='$user'"); $row = mysql_fetch_assoc($result); $attackroll = $row['attackroll']; $defendroll = $row['defendroll']; $defendwin = $defendroll-$attackroll; $attackwin = $attackroll-$defendroll; $attackerpower = $row['attackpower']; $defendpower = $row['cpudefense']; $defendupdate = $attackerpower-$defendwin; $attackupdate = $defendpower-$attackwin; $numbattacker = rand(1,6); $numbdefender = rand(1,6); echo "you rolled a $numbattacker The enemy rolled a $numbdefender <br />"; $query = "UPDATE members SET attackroll = '$numbattacker' WHERE id='$user'"; mysql_query($query); $query = "UPDATE members SET defendroll = '$numbdefender' WHERE id='$user'"; mysql_query($query); mysql_fetch_assoc($result); if ($attackroll<$defendroll){ echo "you lose"; $query = "UPDATE members SET attackpower = '$defendupdate' WHERE id='$user'"; mysql_query($query); mysql_fetch_assoc($result);} if ($attackroll>$defendroll){ echo "you win!"; $query = "UPDATE members SET cpudefense = '$attackupdate' WHERE id='$user'"; mysql_query($query); mysql_fetch_assoc($result);} ?>
-
Like jesirose suggested take the "" out.
-
try <?php $attackroll = $row[attackroll]; $defendroll = $row[defendroll]; $defendwin = $defendroll-$attackroll; $attackwin = $attackroll-$defendroll; ?>
-
im not going to argue there some of my scripts use if file exists
-
no i was still right he was just missing 2 terminators in his code so he got errors
-
instead of include or require try require_once or include_once Try this was missing a ; at the end of the if statement <?php $success = @require("mscript.php"); if (!$success){ die('unable to access MScript'); } $local_pass = "off"; //not active yet $local_mode = "open"; @require("mscript.php"); ?>
-
what is line 12?
-
<?php $success = @require("mscript.php"); if (!$success) { die('unable to access MScript') } $local_pass = "off"; //not active yet $local_mode = "open"; @require("mscript.php") ?>
-
dont ya mean mysql_num_rows ?
-
ok i found the problem the settings file already had that code in it so i removed session_start; now i gotta do the same with captcha.php also done with that now the remaining ERROR: imagecreatefrompng(captcha.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory on line 19 of captcha.php imagecolorallocate(): supplied argument is not a valid Image resource captcha.php on line 26 captcha.php imageline(): supplied argument is not a valid Image resource captcha.php line 34 imagestring(): supplied argument is not a valid Image resource captcha.php line 41 imagepng(): supplied argument is not a valid Image resource captcha.php line 56