
next
Members-
Posts
140 -
Joined
-
Last visited
Everything posted by next
-
nvm, i fixed it
-
for some reason i end up with different layouts in FF and IE, my difference is 2px, see my screenshots for more info: FireFox: IE: Firefox is fine, IE is the one who is broken, how can i fix this? my html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="author" content="next" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta name="robots" content="all" /> <title>AHK</title> <style type="text/css" media="all"> @import "styles.css"; </style> <!-- to correct the unsightly Flash of Unstyled Content. http://www.bluerobot.com/web/css/fouc.asp --> <script type="text/javascript"></script> </head> <body id="bg_grad"> <div id="logo"><span>AHK</span></div> <div id="container"> <form action="login.php" method="post"> <fieldset> <label for="login">log in:<input type="text" name="login" id="login" size="7" /></label> <label for="pass">Password:<input type="password" name="pass" id="pass" size="7" /></label> <input type="submit" value="login" /> </fieldset> </form> <div id="content"> </div> <ul> <li id="home"><a href="#"><span>home</span></a></li> <li id="tutorials"><a href="#"><span>tutorials</span></a></li> <li id="functions"><a href="#"><span>functions</span></a></li> <li id="donate"><a href="#"><span>donate</span></a></li> </ul> </div> </body> </html> my CSS: * {margin: 0; padding: 0;} ul {list-style: none;} a{text-decoration: none;} #bg_grad { background: #DAE0FF url("bg_top.gif") top left repeat-x; } #logo { background: white url("AHK_logo.gif") top left no-repeat; width: 737px; height: 324px; margin-left: 244px; } #logo span {display: none;} #container { width: 700px; min-height: 600px; margin: auto; background: white url("bottom_splash.gif") bottom left no-repeat; } form { background: url("bookmark.gif") top left no-repeat; float: right; margin-top: -300px; height: 220px; width: 379px; } fieldset { border: none; margin: 185px 0 0 90px; } ul li span {display: none;} ul li#home a { display: block; background: url("home.gif") top left no-repeat; width: 100px; height: 100px; margin-left: -50px; } ul li#tutorials a { display: block; background: url("tutorials.gif") top left no-repeat; width: 115px; height: 115px; margin: -10px 0 0 30px; } ul li#functions a { display: block; background: url("functions.gif") top left no-repeat; width: 125px; height: 125px; margin: 10px 0 0 70px; } ul li#donate a { display: block; background: url("donate.gif") top left no-repeat; width: 142px; height: 142px; margin-left: -20px; } Basicaly this part: #logo { background: white url("AHK_logo.gif") top left no-repeat; width: 737px; height: 324px; margin-left: 244px; } controls the logo. Anyone knows how to fix this?
-
just installed Joomla and it keeps buggin me about magic_quotes_gpc, asks me to turn 'em on. For some reason i can't do it. I used phpinfo() to check which config file is being loaded (C:\wamp\bin\apache\apache2.2.8\bin\php.ini), opened it, uncommented and changed the value (exact string from php.ini: ), restarted all services and no result. Joomla still says that it's off and phpinfo() shows them as being off, why? How do i change it? Thanks.
-
Oops , i was missing echo in my secret_page_cookie.php. Problem solved.
-
Playing around with a login form from a book and ran into an issue, can't seem to get what's in my cookies. I have 3 scripts: secret_page_cookie.php: <?php if($_COOKIE['auth'] !== "yes") { header("Location: login_cookie.php"); exit(); } ?> <html> <head> <title>secret_page_cookie</title> </head> <body> <p style = "text-align: center; matgin: 0.5in">Hello <?Php $_COOKIE['first_name']; ?><br />Welcome to secret page.</p> </body> </html> login_cookie.php (form processor): <?php if (isset($_POST['sent'])) { foreach ($_POST as $field => $value) { if (empty($value)) $blank_array[] = $field; else $good_data[$field] = strip_tags(trim($value)); } if (@sizeof($blank_array) > 0) { $message = "<ul style = 'color: red; font-weight: bold;'>"; foreach($blank_array as $error_list) $message .= "<li>$error_list cannot be blank</li>"; $message .= "</ul>"; //extract($blank_array); //extract($good_data); include("form_log.php"); exit(); } $connection = @mysql_connect("localhost", $_POST['user_name'], $_POST['user_password']); if(mysql_error()) { $message = "<p style = 'color: red; font-weight: bold;'>Invalid username or password</p>"; include("form_log.php"); exit(); } mysql_select_db("practice_db"); $query = "SELECT name FROM members WHERE name = '$_POST[user_name]' and password = '$_POST[user_password]'"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); setcookie("first_name", $row['name']); setcookie("auth", "yes"); header("Location: secret_page_cookie.php"); } else { $user_name = ""; $password = ""; include("form_log.php"); } ?> form_log.php <html> <head> <title>form_log</title> </head> <body> <?Php if (isset($message)) echo $message; ?> <form action = 'login_cookie.php' method = 'post' style = 'margin: .5in'> <p><label for = 'user_name' style = 'font-weight: bold; padding-bottom: 1em;'>User ID:</label> <input type = 'text' name = 'user_name' id = 'user_name' /></p> <p><label for = 'password' style = 'font-weight: bold;'>Password:</label> <input type = 'password' name = 'user_password' id = 'user_password' /></p> <p><input type = 'submit' value = 'Log in' /></p> <input type = 'hidden' name = 'sent' value = 'yes' /> </form> </body> </html> So i set up a user in my test DB, i successfully logged in, but when i get to secret_page_cookie.php it's not displaying my name, why??? I checked cookie value using javascript ( javascript:alert(document.cookie) )and everything seems to be fine, i see my variable. How do fix this?
-
So GET is for SEO, got it, thanks!
-
So why/when use GET instead of POST and why both of them exist? As far as i understand they are almost the same except that POST is more secure, what am i missing?
-
damn, i needed to include form.php . Thanks.
-
upload.php <?php if(isset($_POST['submitted'])) { if (!isset($_POST['upload'])) { include "upload.php"; exit(); } if ($_FILES['pix']['tmp_name'] == "none") { echo "<p style = 'font-weight: bold;'>File didn't successfully upload. Check he file size. File must be less than 500K.</p>"; include "upload.php"; exit(); } if (!preg_match("/image/", $_FILES['pix']['type'])) { echo $_FILES['pix']['type']; echo "<p style = 'font-weight: bold';>The file has to be an image."; include "upload.php"; exit(); } $destination = 'C:\data' . "\\" . $_FILES['pix']['name']; $temp_file = $_FILES['pix']['tmp_name']; move_uploaded_file($temp_file, $destination); echo "<p style = 'font-weight: bold';>The file has been successfully uploaded: {$_FILES['pix']['name']} - {$_FILES['pix']['size']}</p>"; } ?> form.php: <html> <head> <title>form</title> </head> <body> <ol> <li>Enter the file name</li> <li>Click Upload Picture</li> </ol> <div style = 'text-align: center'><hr /> <form enctype = "multipart/form-data" action = "upload.php" method = "post"> <P><input type = "hidden" name = "MAX_FILE_SIZE" value = "512000" /> <input type = "file" name = "pix" size = "60" /></p> <input type = "hidden" name = "submitted" value = "1" /> <input type = "submit" name = "upload" value = "Upload Picture"> </form> </div> </body> </html> So if i run form.php, select any file but image, my processing page will start looping upload.php and constantly display echo "<p style = 'font-weight: bold';>The file has to be an image."; . How do i fix this?
-
Ok, i couldn't find a forum on their off-site, so i guess i'll post here. I installed WAMP on my home computer, on PEAR site it says that i shouldn't worry about installation if i have a recent version of PHP, but how do i find out which version of PEAR i currently have installed??? On their site it says: $ pear -v, but i can't get this to work, how do i even start PHP in command line? I found a PEAR folder in C:\wamp\bin\php\php5.2.5\PEAR, the only file in this folder is GO-PEAR.phar, what is this file? I'm so confused . Thanks.
-
Thanks for explaining @. I feel stupid, i had sendmail_from commented out
-
Good morning, 1) I have the following code: function process_form($data) { $msg = "The form at {$_SERVER['PHP_SELF']} was submitted with these values:\r\n"; foreach($data as $key => $val) $msg .= "$key => $val \r\n"; mail('[email protected]', 'form submission test', $msg); } For some reason php return an error: I changed php.ini and still get this error message and php docs don't show a custom FROM parameter in mail function, how do i fix this? My Php.ini: 2) <input type = "text" name = "first" value = "<?php echo @$method['first']; ?>" /> What is the purpose of '@' in @$method['first']; ? Thanks.