PHP - Css Messed Up In Ie9, Mozilla & Iphone
Hello guys, hope you are doing good. I urgently need your help at a point where I am stuck. I have created this form and applied some css to it. If I am viewing that form using Google Chrome, it looks perfectly fine but when I am viewing it using IE9 or Mozilla or viewing it on my iPhone, the whole border, button etc. gets messed up. Anybody knows how I can fix this so that it looks completely fine no matter if one is viewing it using any browser? The form can be viewed over here http://sigmalogistix.com/index3.php and this is the code:
Code: [Select] <html> <head> <title>Login - Sigma Logistics</title> <style type="text/css"> form { padding:5px 450px; } img { padding:20px 521px; } a:link { color:#43759b; text-decoration:underline; } a:visited { color:#43759b; text-decoration:underline; } a:hover { color:#43759b; text-decoration:underline; } a:active { color:#43759b; text-decoration:underline; } a.otherLink:link { color:#43759b; text-decoration:none; } a.otherLink:visited { color:#43759b; text-decoration:none; } a.otherLink:hover { color:#43759b; text-decoration:underline; } a.otherLink:active { color:#43759b; text-decoration:none; } label { width: 12.2em; float: left; text-align: right; margin-right: 0.5em; display: block } .submit input { margin-left: 10.5em; } input { color: #47596e; background: #fee3ad; border: 1px solid #47596e; margin-left: 3.6em } .submit input { color: #000; background: #ffa20f; border: 2px outset #d7b9c9 } fieldset { border: 2px solid #47596e; width: 21em -moz-box-shadow: 0px 5px 12px #cdd0cc; box-shadow: 0px 5px 12px #cdd0cc; } legend { color: black; background: #ffa20c; border: 2px solid #47596e; padding: 2px 6px } </style> </head> <img src="http://sigmalogistix.com/wp-content/uploads/2012/02/Untitled-22.png" /> <form action='login.php' method='POST'> <fieldset> <legend>Track & Trace</legend> <p><label for="username"><font face="Arial" size="2">Username</font></label> <br><input type="text" name="username" size="35" /></p> <p><label for="password"><font face="Arial" size="2">Password</font></label> <br><input type="password" name="password" size="35" /></p> <p class="submit"><input type="submit" value="Log in" /></p> <a href='http://www.sigmalogistix.com'>← <font size="2" face="Arial">Back to Sigma Logistics</font></a> </fieldset> </form> </html> This is how it looks when I view it using Google Chrome 19 (everything's perfect). This is how it looks when I view it using Firefox 12 (notice that the shadow behind the form is misaligned). This is how it looks when I view it using IE9 (everything's misaligned ) And this is on iPhone's Safari browser. Please help me guys, thanks. Similar TutorialsHi, I am new trying to make a simple test iPhone app that reads data from a MySql server via php get method. As a test I used a 'film' database but soon realised that if the get method contains two words '%20' is added to the middle. As a workaround, I tried: if (strpos($_GET['film'], '%20') !==false) $film = str_replace("%20", " ", $_GET['film']; else $_GET[film]=$film; and then appending $film to the end of my sql query. I have tried many variations of this but cannot get it to work! Any advice would be much appreciated. Niall Is it possible to retrieve a visitor's iPhone device id? If so, how? If it's not possible, do all iPhones accept cookies? Whenever a valid ID is entered, my page stops loading and when it finally does load, it gives a lot of MySQL connection errors. What is wrong with my function code? <?php include_once("includes/config.php"); if(!$_GET['id'] && $_POST['id']) { $id = mysql_real_escape_string($_POST['id']); } elseif($_GET['id'] && !$_POST['id']) { $id = mysql_real_escape_string($_GET['id']); } else { } if(!$id) { $content = "Sorry, you have not selected a skin to view."; } else { $extract_information = mysql_query("SELECT title,username,id,password,description FROM skins WHERE id = '$id' LIMIT 1"); function displayBody($id) { mysql_query("UPDATE skins SET views = views + 1 WHERE id = '$id'"); $content = (displayBody($id)) ? $extract['title']. ", by ". $extract['username'] .".<br/><br/>Description: ". $extract['description'] ." - <a href='view.php?download=". $extract['id'] ."'>Download</a><br/><br/> <img src='skins/". $extract['id'] .".png' width='500' height='300'>" : NULL; return true; } if(mysql_num_rows($extract_information) == 0) { $content = "Sorry, no skin exists with this ID."; } else { $extract = mysql_fetch_assoc($extract_information); if($_GET['download']) { $does_exist_download = mysql_query("SELECT title,username,id,password,description FROM skins WHERE id = '$id' LIMIT 1"); if(mysql_num_rows($does_exist_download) == 0) { $content = "No skin exists with this ID, so you may not download."; } else { mysql_query("UPDATE skins SET downloads = downloads + 1 WHERE id = '". mysql_real_escape_string($_GET['download']) ."'"); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header( "Content-Disposition: attachment; filename=skins/".$extract['id'].".png"); header( "Content-Description: File Transfer"); @readfile($file); } } elseif(!$extract['password']) { displayBody($id); } elseif(!$_POST['password']) { $content = "<br/><br/><div id='header'>Password</div> <center><form action='view.php' method='POST'> <input type='hidden' name='id' value='". $id ."'>Password: <input type='password' name='password' maxlength='6'> <input type='submit' value='View'></form></center>"; } else { if($_POST['password'] != $extract['password']) { $content = "You have entered in an incorrect password. <a href='view.php?id=". $id ."'>Try Again</a> or <a href='index.php'>Home</a>."; } else { displayBody($id); } } } } ?> <html> <head> <title><?php $title; ?></title> <link rel="stylesheet" type="text/css" href="theme/style.css" /> </head> <body> <div id="header"> MCSkins </div> <?php echo $content; ?> </center> </body> </html> Hi everybody
I want to put this code (or something like that) in my index.php to redirect the iPhones etc.
But where do I have to put it in? In the head or body?? And how can I call this function?
Thanks a lot for helping a beginner!
function ismobile(){ $useragent = $_SERVER[‘HTTP_USER_AGENT’]; // Standard vendor-model/version user agents if(preg_match(‘/^((ACER¦Alcatel¦AUDIOVOX¦BlackBerry¦CDM¦Ericsson¦LG\b¦LGE¦Motorola¦MOT¦NEC¦Nokia¦Panasonic¦QCI¦SAGEM¦SAMSUNG¦SEC¦Sanyo¦Sendo¦SHARP¦SIE¦SonyEricsson¦Telit¦Telit_mobile_Terminals¦TSM)[- ]?([^\/\s\_]+))(\/(\S+))?/’, $useragent)){ return true; }else{ return false; } } This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=347457.0 Hello, I have a very big problem with stolen data and i don't know how to STOP that. The situation : I have a website where i spend lot of time to register events and info on events (something like www.CoolEvents.com) Users can log in and then comment events, and do others actions when logged. The PROBLEM : Someone created AN IPHONE APPLICATION that is an EXACT copy of my website, and is name CoolEvent App !!! Same infos, same comments, and you can log in via this app (parsing my site) and post comment on my website ! It's horrible for me, because 40% of my users now used this application (who earn money by displaying advertising). So i losed 40% of visitors !!! Without using legal channels, how can i STOP an IPHONE APP to parse my website or to acces to my website ? Do you know a TECHNICAL solution to prevent an APP to PARSE and then copy my website ? At least, is it possible to made it IMPOSSIBLE to log in to my website (and so be able to post comment on my site) by using this APP ? Thanks for your help !! Hello. i have created a template in dreamweaver, however when i added php code to a page the position of my bottom div got messed up... it works 100% with just text. I have a container div with other divs in it. inside the container div i have a div named content, and this div is the only div which is editable. in the bottom (outside of the container div) i have a bottom div which is centered with margin:0 auto; this divs position gets totally messed up once i add php code in the content div. http://elevweb.skit.no/0111nema/action_adventure.php here is the link to the page with php with it, as u can see the div with facebook etc in it got a messed up position. I have a huge anonymous posting board, which relies on cookies to keep track of people. Everything works fine except for logging out. When i print_r the cookie i can see the following. When i log out the cookie is reset ... i can go to pages like www.mysite.com/page.php - but as soon as i go to a site with a modrewrite it goes back to the old cookie. ive tried setting cookies with the ending "\" however this does not seem to fix the problem. I believe the problem comes from the login cookie is set in the mysite/login/ tab and it checks for the cookie in the mysite.com/index.php tab. Hi Guys,
I have a navigation menu that works great on a desktop however on a mobile or touch screen device the navigation menu doesn't seem to pause when i click on the drop down menu. Any help with a solution to this?
index.php with menu
<div class="header"> <div class="nav"> <ul class="drop-menu"> <li><a class="first current" href="#"><span class="first-border-left"> </span>home</a></li> <li><a href="#" title="About Us">about us</a> <ul> <li><a href="#" title="Latest News">Latest News</a></li> <li><a href="#" title="Why choose us">Why choose us</a></li> <li class="end"><a href="#" title="Mission Statement">Mission Statement</a></li> </ul> </li> <li><a class="last" href="#" title="Contact Us"><span class="first-border-right"> </span>Contact Us</a></li> </ul> </div> </div>css file .header .nav {min-height:58px; position:absolute; top:193px; z-index:6;} .drop-menu { margin:0 0 0 0px; padding:0 0 0 0px; list-style: none; width:940px; font-size:14px; line-height:58px; text-transform:uppercase; } .drop-menu li a { text-decoration:none; color:#fff; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; width:146px; text-align:center; display:block; border-right:1px solid #616161; background:url(menu-tail.gif) 0 0 repeat-x #0c2362; } .drop-menu li a:hover { color:#fff; background:url(menu-hover.gif) 0 0 repeat-x #0c2362; } .drop-menu li.dropHover a { background:url(menu-hover.gif) 0 0 repeat-x #0c2362; } .drop-menu a.current { color:#3e3e3e; background:url(menu-active.png) 0 0 repeat-x #d8d6d6; border-top:none; } .drop-menu li.dropHover a.current { color:#3e3e3e; background:url(menu-active.png) 0 0 repeat-x #d8d6d6; } .drop-menu ul { position: absolute; top: -999em; background:url(submenu-tail.png) 0 0 repeat !important; } .drop-menu ul li { width: 100%; } .drop-menu li:hover { visibility: inherit; } .drop-menu li { position: relative; background:none; float:left; line-height:58px; height:58px; } .drop-menu li li { font-size:12px; height:40px; line-height:40px; background:url(menu-spacer.gif) center bottom no-repeat; } .drop-menu li .end { border:none; background:none; } .drop-menu li li a { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-weight:bold; color:#fff; line-height:40px; height:40px; width:188px; overflow:hidden; display:block; border:none; background:none !important; } .drop-menu li li li { height:34px; line-height:34px; } .drop-menu li li a:hover, .drop-menu li li.dropHover a { color:#038ee7; } .drop-menu li li li a { height:34px; width:200px; font-size:12px; padding:0; margin:0; color:#fff !important; text-align:center; line-height:34px; border:none; background:url(menu-spacer.gif) center bottom no-repeat; } .drop-menu li li li a:hover { color:#038ee7 !important; } .drop-menu li li li li { height:34px; line-height:34px; } .drop-menu li li li li a { height:34px; width:200px; font-size:12px; padding:0; margin:0; color:#0c2362 !important; text-align:center; line-height:34px; border:none; background:url(menu-spacer.gif) center bottom no-repeat; } .drop-menu li li li li a:hover { color:#038ee7 !important; } .drop-menu a { display: block; position: relative; } .drop-menu li:hover ul, .drop-menu li.dropHover ul { left: -1px; top: 58px; z-index: 99; } ul.drop-menu li:hover li ul, ul.drop-menu li.dropHover li ul { top: -999em; } ul.drop-menu li li:hover ul, ul.drop-menu li li.dropHover ul { left: 188px; top: 0; } ul.drop-menu li li:hover li ul, ul.drop-menu li li.dropHover li ul { top: -999em; } .drop-menu .first { width:84px; border-right:1px solid #616161; position:relative; } .drop-menu .first span.first-border-left { width:6px; height:58px; float:left; background: url(nav_left.png) top left no-repeat; } .drop-menu .last span.first-border-right { width:6px; height:58px; float:right; background: url(nav_right.png) top right no-repeat; } .drop-menu .last { width:120px; border-right:none; position:relative; } How can I recover deleted iphone contacts?
I tried both of these articles, I have a windows 8.1 tablet and both of the different "codes" worked but I tried my friend's iPhone and the camera viewport is just a black square or doesn't show at all... the problem seems to be that the pop up where you push "allow" or "deny" doesn't show up at all, this makes me think the trigger isn't "triggered".
These are the sites
I'm using HTML5 and Javascript, didn't do much modifcation yet, I just needed the basic web cam access, cropping, saving functions at the moment.
http://davidwalsh.name/browser-camera
http://mycodingtrick...ipt/webcam-api/
I want to build a online "app builder" project that users can create android / iphone applications online without any coding knowledge. These sites are very common in market. They offer onclick app builder. I have skill in development of web applications using php frameworks. My question is How we can generate android apk from our server after getting the necessary information from user? (Appname, icon, packagename etc) PHP can do this entire task?, if yes any framework for that? Can you give me some basic tips to generate apk from our server? Can we genrate both android and iphone app from one single code? What are the requirements needed for the server? Anybody having skills in these areas, please help me. I need basic tips to get started this project. Thanks Hey guys I'm using a php based form for my website to take contact information and an attachment from a user and it sends it to my company email address. All the email account information is correct because when I open the message up in Microsoft Outlook I get the information and the attachments. However, when I try to open up the message on my iPhone 4, I just get information with no attachments. I frequently check my email from my iPhone because sometimes I am not able to make it to my computer to use Outlook. I would really like for this to work and would appreciate any help you guys have. Not sure if it is needed but here is the code for the from I use: <?php //turn off error reporting --easily commented out for development, but keeps site visitors from seeing any random thrown errors error_reporting(0); // specify the recipients and subject $to = "test@mywebsite.com"; $subject = "Someone Has Requested A Quote"; //grab all our vars from the form extract($_POST); //build the body of the message from the form $body = " The Quote Requested Name: $fname $lname Company: $company Phone Number: $phone Ext: $phoneext Description: $description Best time to call: $call "; //Let's start our headers $headers = "From:noreply@mywebsite.com\r\n"; //$headers .= "Reply-To:PUT_YOUR_EMAIL_ADDRESS_OR_VARIABLE_HERE\r\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"----=MIME_BOUNDRY_main_message\"\n"; $headers .= "X-Sender:noreply@mywebsite.com\r\n"; $headers .= "X-Mailer: PHP5\n"; $headers .= "X-Priority: 3\n"; //1 = Urgent, 3 = Normal //$headers .= "Return-Path:PUT_YOUR_EMAIL_ADDRESS_OR_VARIABLE_HERE\r\n"; $headers .= "This is a multi-part message in MIME format.\n"; $headers .= "------=MIME_BOUNDRY_main_message \n"; $headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUNDRY_message_parts\"\n"; $message = "------=MIME_BOUNDRY_message_parts\n"; $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $message .= "Content-Transfer-Encoding: quoted-printable\n"; $message .= "\n"; /* Add our message, in this case it's plain text. You could also add HTML by changing the Content-Type to text/html */ $message .= "$body\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_message_parts--\n"; $message .= "\n"; /*deal with mulitple attachments */ foreach($_FILES as $file => $value) { $_tmpname = $_FILES[$file]['tmp_name']; $_filename = $_FILES[$file]['name']; if (is_uploaded_file($_tmpname)) { //Do we have a file uploaded? $fp = fopen($_tmpname, "rb"); //Open it $data = fread($fp, filesize($_tmpname)); //Read it $data = chunk_split(base64_encode($data)); //Chunk it up and encode it as base64 so it can emailed $message .= "------=MIME_BOUNDRY_main_message\n"; $message .= "Content-Type: application/octet-stream;\n\tname=\"" . $_filename . "\"\n"; $message .= "Content-Transfer-Encoding: base64\n"; $message .= "Content-Disposition: attachment;\n\tfilename=\"" . $_filename . "\"\n\n"; $message .= $data; //The base64 encoded message $message .= "\n\n"; fclose($fp); } } $message .= "------=MIME_BOUNDRY_main_message--\n"; // set specific SMTP for this message - you may not need this, but I have to manually set the SMTP because it is not localhost ini_set('SMTP','mail.mywebsite.com'); // send message to recipients @mail( $to, $subject, $message, $headers ); // redirect to thank you page after sending email header("Location: http://www.mywebsite.com/quoteComplete.html"); ?> Hi,
I have a booking form that displays fine on a desktop and other mobile devices, except on an iPhone 5. Does anyone know what could cause this? I know javascript is working on the iPhone, but not sure why the form isnt displaying.
Thanks
So whether I am uploading an image through my iphone or sending that image to my computer and uploading it from the computer, it has the same effect. If I upload that image, it'll orient the image in landscape mode. Having said that, I found a function that can fix the orient issue. The problem is I don't know the proper way to integrate it into the image upload script. I have tried several different ways but they all give me errors. Can you show me where exactly I should use this function? // IMAGE ORIENTATION function getOrientedImage($imagePath) { $image = imagecreatefromstring(file_get_contents($imagePath)); $exif = exif_read_data($imagePath); if(!empty($exif['Orientation'])) { switch($exif['Orientation']) { case 8: $image = imagerotate($image,90,0); swapHW(); break; case 3: $image = imagerotate($image,180,0); break; case 6: $image = imagerotate($image,-90,0); swapHW(); break; } } return $image; } // IMAGE UPLOAD SCRIPT if(isset($_FILES['fileToUpload']) AND !empty($_FILES['fileToUpload']["name"])) { if(is_uploaded_file($_FILES['fileToUpload']["tmp_name"])) { $target_dir = '../members/images/'.$global_user_id.'/projects/'.$url_project_id.'/'; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); $source_file = $_FILES["fileToUpload"]["tmp_name"]; $random_name = generateRandomString(10); $new_image = $random_name . '.' . $imageFileType; $resized_image = compressImage($source_file, $new_image, 50); $new_file_path = $target_dir . $resized_image; if(!is_dir($target_dir)){ mkdir($target_dir, 0775, true); } $uploadOk = 1; // Check if image file is a actual image or fake image $check = getimagesize($source_file); if($check !== false) { // echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { $errors[] = 'File is not an image!'; $uploadOk = 0; } // Check if file already exists if (file_exists($target_file)) { $errors[] = 'Sorry, file already exists!'; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 5000000) { $errors[] = 'Sorry, your file size is bigger than 5mb!'; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" && $imageFileType != "JPG" && $imageFileType != "PNG" && $imageFileType != "JPEG" && $imageFileType != "GIF") { $errors[] = 'Sorry, only JPG, JPEG, PNG & GIF files are allowed!'; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if($uploadOk == 0) { $errors[] = 'Sorry, your file was not uploaded!'; // if everything is ok, try to upload file } else { if(rename($new_image, $new_file_path)) { echo 'success'; } else { $errors[] = 'Sorry, there was an error uploading your file!'; } } } else { $errors[] = 'You must upload an image!'; } } Edited December 23, 2019 by imgrooot Hey everyone this is really really simple. say my site is www.mywebsite.com in my index page I have this define('PHPSITE_DIR', 'mywebsite'); require_once(PHPSITE_DIR . '/test/hello.php'); I have a folder named test and inside the folder i have hello.php but when i go to www.mywebsite.com i get Code: [Select] Warning: require_once(mywebsite/test/hello.php) [function.require-once]: failed to open stream: No such file or directory in wtf? i'm using godaddy server if that matters Hello,
Trying to rearrange a data on the website. Looks normal when looking through preview on IE and chrome. But once moved to live website, the whole alignment changes from left to center , including the text that needs to show up. I am a newbie to coding and dont have a clue. tried puttng something together based on what i foud on the web. attaching screenshot and the code that i did. any help is highly appreciated. also attached is a screenshot of what happens when the php file is uploaded. Prior to doing that, the menu on the left is aligned properly and the assets that we have show properly.
What we are trying to do is rearrage the whole assets into different categories.
many thanks
Attached Files
portfolio.php 3.27KB
2 downloads
noalignment.png 11KB
0 downloads I have a notification system that notifies users of new comments, inside the email I have images, some of the logo, some of different people, everything shows up fine on my computer (yahoo email), however in the iPhones email application no images show up, there are just the blue squares with the question marks in them. I'm not sure what I'm missing. Code: [Select] $from = "Kithell <notifications@kithell.com>"; $headers = "From:" . $from ."\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $subject = name($from_id, 'fl').$action; $message = '<html><body> <style>@charset "utf-8"; /* CSS Document */ .e-container { background-color: #FFF;position: relative;width: 90%;min-height:1px;margin-right: auto;margin-left: auto; } .e-container .e-m-header { padding: 2px; background-image: url(http://www.kithell.com/assets/tall-grey-header.png); background-repeat: repeat-x; border: 1px solid #CCC; background-position: bottom; display: block; text-align: center; } .e-container p { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #666; vertical-align: text-top; display: inline-block; } .e-container .e-usr-photo { display: inline-block; margin: 10px; float: left; background-color: #F4F4F4; } .e-container p a { font-weight: bold; color: #3F60A3; text-decoration: underline; padding: 0px; float: left; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 0px; } .e-container .e-quotes { font-size: 20px; font-weight: bold; color: #999; font-family: Tahoma, Geneva, sans-serif; display: block; padding: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 75px; margin-top:10px; } .e-container .e-message { font-size: 13px; color: #333; padding: 0px; margin-top: 0px; margin-right: 10px; margin-bottom: 0px; margin-left: 10px; clear: none; display: inline; }</style> <div class="e-container"><div class="e-m-header"><img src="http://www.kithell.com/assets/kithell-logo.png" /></div><img class="e-usr-photo" src="http://www.kithell.com/'.photo($from_id, 55).'" /><br /><p><a target="_blank" href="http://www.kithell.com/#/profile&id='.$from_id.'">'.name($from_id, "fl").' </a> '.$action.'<div class="e-quotes">"<p class="e-message">'.nl2br(htmlentities(stripslashes($message))).'</p>"</div></p></div></body></html>'; mail($to,$subject,$message,$headers); This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=345904.0 I have a Create new account page. The form is in page named Register.php and once user submit it, it will go to Confirm.php, where it validates the field if everything is correct shows the " Account Created " Message. In Chrome. The error message is shown in Register.php and once all fields are filled then only will show confirm.php. But in Mozilla, it goes to Confirm.php and shows a blank page. My code for Register.php is : Code: [Select] <div class="signup_form"> <form action="confirm.php" method="post" > <?php session_start(); if(isset($_SESSION['error'])) { echo '<p>'.$_SESSION['error']['username'].'</p>'; echo '<p>'.$_SESSION['error']['email'].'</p>'; echo '<p>'.$_SESSION['error']['password'].'</p>'; unset($_SESSION['error']); } ?> <p> <font size="3" face="arial" color="gray"> <label for="username"><b> UserName*</b> </label> </font> <input name="username" type="text" id="username" input style="height:33px" size = "50" size="30"/> </p> <p> <font size="3" face="arial" color="gray"> <label for="email"><b> E-mail Address*</b> </label> </font> <input name="email" type="text" id="email" input style="height:33px" size = "50" size="30"/> </p> <p> <font size="3" face="arial" color="gray"> <label for="password"><b> Password*</b> </label> </font> <input name="password" type="password" id="password" input style="height:33px" size = "50" size="30"/> </p> <p> <input name="submit" type="image" src="images/submit.gif" value="submit"/> </p> </form> </div> and for Confirm.php code is : Code: [Select] <?php session_start(); include('configdb.php'); if(isset($_POST['submit'])) { if($_POST['username'] == '') { $_SESSION['error']['username'] = "User Name is required."; } if($_POST['email'] == '') { $_SESSION['error']['email'] = "E-mail is required."; } else { if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $_POST['email'])) { $email= $_POST['email']; $sql1 = "SELECT * FROM user WHERE email = '$email'"; $result1 = mysqli_query($mysqli,$sql1) or die(mysqli_error($mysqli)); if (mysqli_num_rows($result1) > 0) { $_SESSION['error']['email'] = "This Email is already used."; } } else { $_SESSION['error']['email'] = "Your email is not valid."; } } if($_POST['password'] == '') { $_SESSION['error']['password'] = "Password is required."; } if(isset($_SESSION['error'])) { header("Location: register.php"); exit; } else { $username = $_POST['username']; $email = $_POST['email']; $password = $_POST['password']; $sql2 = "INSERT INTO users (username, email, password) VALUES ('$username', '$email', '$password')"; $result2 = mysqli_query($mysqli,$sql2) or die(mysqli_error()); if($result2) { echo '<div>Your account is now active. You may now <a href="login.php">Log in</a></div>'; |