PHP - Character Encoding, Web Page And Database
Hi
A really basic question, with regards to best practice, but I can't find an answer anywhere. Should the charset in my website be set to match the charset used by my database? E.g. Database is utf-8, so website should be set to utf-8? Similar TutorialsI submit text to my MySQL database using a form on my site. When I look at the text in my database, sometimes, there are strange characters. The strange characters are caused by quotation marks, em dashes, apostrophes and foreign letters of the alphabet. I think that this only happens when the source of the text is a Windows program. I understand that this is a character encoding issue, but I don't fully understand the subject. I've spent the last few hours researching it, but it's only confused me.
My site uses UTF-8 encoding:
<meta http-equiv="content-type" content="text/xml; charset=utf-8" />The collation of my database is utf8_general_ci. My form looks like this: <form action="" method="post"> </form>As you can see, an accept-charset="utf-8" attribute has not been specified. Questions 1) I am guessing that my problem is that the Windows characters are being misinterpreted by my UTF-8 setup. Is that correct? 2) If so, is there a way that I can safely convert the Windows characters to UTF-8 during the submission process? 3) Should I also specify an accept-charset="utf-8" attribute on the form? 4) When I paste the Windows text directly into my database without using the form, the characters save without turning into the strange characters. But they don't render properly on my site. Can't browsers identify Windows characters? Hi, does anybody know why I get a question mark inside a diamond shape where a pound sign should be when i retrieve data from a mysql database? I have tried using latin1_general_ci and utf8_general_ci and they both do the same, don't know whether that is anything to do with it or not? Any help would be greatly appreciated. So I've recently started looking into Character Encoding, after never really bothering with it, and I've got a few questions. After checking out my site it seems I've been using UTF-8 without really realising it, and I'm going to stick with UTF-8. However, when I jump into phpMyAdmin to check out my MySQL tables I run into a few problems. Originally, for my database, the collation was set to latin1_swedish_ci. I have since changed this to utf8_general_ci. This however only affects newly created tables, not the 150 or so tables I currently have which are still latin1_swedish_ci. Do I need to convert the collation of these already existing tables to UTF-8, and if so what's the best method? This takes me to my text editor, NetBeans 7. Do I need to alter anything here, I've not been successful with finding information relating to this? Cheers guys. I am terribly confused... I am trying to display the html body of a message pulled through imap. I thought that if I did this: <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> in the html head, that everything would be pretty much figured out for me, but... When I look at the original message in gmail (prior to being pulled with imap), I get an ellipses(...), but once I display it in my browser, I get a black diamond question mark thingy... Help! I've tried all manners of conversion, but suspect I'm completely missing the boat here. Thanks Not sure where to post this question. I have a MySQL database and add records with a PHP form to the tables. I have 2 fields (char) in one table. When the fields contain the character ' it wont write the record to the table! For example...if I enter. " John's house" it wont accept the record since ' appears in John's name! How do I work around this? Thanks I have a PHP Form where users have to enter and upload a file but when they click upload everything is working except that it is only sending first character of text field to Database! Can any one help?? Thanks File upload.php form Code: [Select] <form action="add_file.php" method="post" enctype="multipart/form-data"> <p><br> JobID: <input name="JobID" type="text" value="<?php echo $row_Recordset1['JobID']; ?>" readonly="readonly" /> </p> <p>Company ID: <input name="CompanyID" type="text" value="<?php echo $row_Recordset1['CompanyID']; ?>" readonly="readonly" /> </p> <p>UserID: <input name="UsersID" type="text" /> </p> <p>Select File to upload: <input type="file" name="uploaded_file" /> </p> <p>Make Sure All Details Are Correct before Submitting!</p> <p> <input type="submit" value="Submit Application" /> </p> <form> add_file.php // Check if a file has been uploaded if(isset($_FILES['uploaded_file'])) { // Make sure the file was sent without errors if($_FILES['uploaded_file']['error'] == 0) { // Connect to the database $dbLink = new mysqli('localhost', 'user', 'password', 'phpsite'); if(mysqli_connect_errno()) { die("MySQL connection failed: ". mysqli_connect_error()); } // Gather all required data $JobID = $dbLink->real_escape_string($_POST['JobID']['JobID']); $CompanyID = $dbLink->real_escape_string($_POST['CompanyID']['CompanyID']); $UsersID = $dbLink->real_escape_string($_POST['UsersID']['UsersID']); $name = $dbLink->real_escape_string($_FILES['uploaded_file']['name']); $mime = $dbLink->real_escape_string($_FILES['uploaded_file']['type']); $data = $dbLink->real_escape_string(file_get_contents($_FILES ['uploaded_file']['tmp_name'])); $size = intval($_FILES['uploaded_file']['size']); // Create the SQL query $query = " INSERT INTO `application` ( `JobID`, `CompanyID`, `UsersID`, `name`, `mime`, `size`, `data`, `N_DateAndTime` ) VALUES ( '{$JobID}', '{$CompanyID}', '{$UsersID}', '{$name}', '{$mime}', {$size}, '{$data}', NOW() )"; // Execute the query $result = $dbLink->query($query); // Check if it was successfull if($result) { echo 'Success! Your job application was successfully sent!'; } else { echo 'Error! Failed to insert the file, please try again' . "<pre>{$dbLink->error}</pre>"; } } else { echo 'An error accured while the file was being uploaded, please try again. ' . 'Error code: '. intval($_FILES['uploaded_file']['error']); } // Close the mysql connection $dbLink->close(); } else { echo 'Error! A file was not sent! Please try again!'; } // Echo a link back to the main page echo '<p>Click <a href="year1index.php">here</a> to go back</p>'; ?> MOD EDIT: [code] . . . [/code] BBCode tags added. First and foremost I am PHP newbie so excuse the dumb question but I have been struggling with this one for hours and can not find the solution. Can someone show me how I would rewite the following wordpress code for meta tags so that it automatically strips out the character ' from the "single" page titles? Example I want this title: "My Cat's Black" to be "My Cats Black" This is the line I am trying to edit..... Code: [Select] elseif ( is_single() ) { wp_title(''); print ' | '; bloginfo('name'); } here is the full piece of code... Code: [Select] <title><?php if ( is_home() ) { bloginfo('name'); print ' | '; bloginfo('description'); } elseif ( is_search() ) { bloginfo('name'); print ' | '; _e('Search Results', 'woothemes'); } elseif ( is_author() ) { bloginfo('name'); print ' | '; _e('Author Archives', 'woothemes'); } elseif ( is_single() ) { wp_title(''); print ' | '; bloginfo('name'); } elseif ( is_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); } elseif ( is_category() ) { single_cat_title(); print ' | '; bloginfo('name'); } elseif ( is_month() ) { _e('Archive', 'woothemes'); print ' | '; the_time('F'); bloginfo('name'); } elseif (function_exists('is_tag')) { if ( is_tag() ) { bloginfo('name'); print ' | '; _e('Tag Archive', 'woothemes'); print ' | '; single_tag_title("", true); } } ?></title> Any help would be greatly appreciated!! I have a standard form that displays users current data from a mysql database once logged in(code obtained from the internet). Users can then edit their data then submit it to page called editform.php that does the update. All works well except that the page does not display the updated info. Users have to first logout and login again to see the updated info. even refreshing the page does not show the new info. Please tell me where the problem is as i am new to php.
my form page test.php
<?PHP require_once("./include/membersite_config.php"); if(!$fgmembersite->CheckLogin()) { $fgmembersite->RedirectToURL("login.php"); exit; } ?> <form action="editform.php?id_user=<?= $fgmembersite->UserId() ?>" method="POST"> <input type="hidden" name="id_user" value="<?= $fgmembersite->UserId() ?>"><br> Name:<br> <input type="text" name="name" size="40" value="<?= $fgmembersite->UserFullName() ?>"><br><br> Email:<br> <input type="text" name="email" size="40" value="<?= $fgmembersite->UserEmail() ?> "><br><br> Address:<br> <input type="text" name="address" size="40" value="<?= $fgmembersite->UserAddress() ?> "><br><br> <button>Submit</button>my editform.php <?php $con = mysqli_connect("localhost","root","user","pass"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } mysqli_query($con,"UPDATE fgusers3 SET name = '".$_POST['name']."', email= '".$_POST['email']."', address= '".$_POST['address']."' WHERE id_user='".$_POST['id_user']."'"); header("Location: test.php"); ?> This include does not work. I presume due to the ? in it. <?php include("signin-redirect.php?page=my-account.php");?> It works as just signin-redirect.php but I want to include the ?page=my-account.php on the end of it. Thanks Hi guys, just wondering if someone can help me i am currently trying to edit a MYSQL database through PHP and just wondering if you could take a look at the code i have and tell me where i have gone wrong. I have tried to use a tutorial but have got lost and need some help. This is for my final year project for University and really needs to be done soon so i would be really greatful if someone could help me out. Thanks code below: Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <link rel="stylesheet" type="text/css" href="style.css"/> <title>Database Editor</title> </head> <body> <div id="page"> <img src="images/banner1.jpg" alt="banner"/> <div id="navi-container"> <ul id="navi"> <li><a href="index.php">Home</a></li> <li><a href="news.php">News</a></li> <li><a href="latest_products.php">Latest Products</a></li> <li><a href="gallery.php">Gallery</a></li> <li><a href="Admin_page.php">Administration</a></li> </ul> </div> <?php ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <h1>Database Editor</h1> <table class="inputtable"> <tr> <td class="label">Item Name:</td> <td class="inputtd"> <input name="Item_Name" type="text" class="standardwidth" /></td> </tr> <tr> <td class="label"> Item Image:</td> <td class="inputtd"> <input name="Item_Image" type="text" class="standardwidth" /></td> </tr> <tr> <td class="label">Item Description:</td> <td class="inputtd"> <input name="Item_Description" type="text" class="standardwidth" /></td> </tr> <tr> <td class="label">Item Number:</td> <td class="inputtd"> <input name="Item_Number" type="text" class="standardwidth" /></td> </tr> </table> <br /> <table class="radbuttons"> <tr> <td class="standardwidth"> <input name="op" type="radio" checked="checked" value="rdbase" /> Read from Database</td> <td><input name="op" type="radio" value="cdbase" />Change Entry (enter data in form)</td> </tr> <tr> <td class="standardwidth"> <input name="op" type="radio" value="adbase" />Add to Database</td> <td><input name="op" type="radio" value="ddbase" />Delete Entry (enter name in form)</td> </tr> </table> <br /> <input name="submit" type="submit" value="submit" /> <input name="reset" type="reset" value="reset" /> <br /> </form> <?php if (count($view->peopleList) > 0) { ?> <table class="datatable"> <tr> <th><strong>Surname</strong></th> <th><strong>First Name </strong></th> <th class="standardwidth"><strong>Address </strong></th> <th><strong>Phone</strong></th> </tr> <?php foreach ($view->peopleList as $person) : ?> <tr> <td> <?php echo $person->getSurname(); ?> </td> <td> <?php echo $person->getFirstname(); ?> </td> <td> <?php echo $person->getAddress(); ?> </td> <td> <?php echo $person->getPhone(); ?> </td> </tr> <?php endforeach; } ?> </table> <?php ?> <?php $dbc = mysql_connect ('****','***','salford*****') OR die('Could not connect to MySQL : ' . mysql_error() ); mysql_select_db ('****') OR die('Could not select the database : ' . mysql_error() ); $query = "SELECT * FROM ****** ORDER BY Item_Number"; $result = mysql_query ($query); ?> <body> <h1>Database</h1> <table border="1"> <tbody> <tr> <td>Item Name</td> <td>Item Image</td> <td>Item Description</td> <td>Item Number</td> </tr> <?php while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { echo " <tr> <td>$row[Item_Name]</td> <td>$row[Item_Image]</td> <td>$row[Item_Description]</td> <td>$row[Item_Number]</td> </tr> "; } mysql_close(); ?> $sql = 'INSERT INTO murrayfp10_ipad (Item_Name, Item_Description, Item_Number) VALUES (:Item_Name, :Item_Description, :Item_Number)'; $result = $this->dbh->prepare($sql); $result->execute(array( ':Item_Name' => $data['Item_Name'], ':Item_Description' => $data['Item_Description'], ':Item_Number' => $data['Item_Number'] )); return $this->dbh->lastInsertId(); } public function edittbl($data) { $sql = 'UPDATE murrayfp10_ipad SET Item_Name = :Item_Name, Item_Description = :Item_Description, Item_Number = :Item_Number WHERE Item_Name = :Item_Name'; $result = $this->dbh->prepare($sql); return $result->execute(array( ':Item_Name' => $data['Item_Name'], ':Item_Description' => $data['Item_Description'], ':Item_Number' => $data['Item_Number'], ':Item_Number' => $data['Item_Number'] )); } public function deletetbl($data) { $sql = 'DELETE FROM murrayfp10_ipad WHERE Item_Name = :Item_Name'; $result = $this->dbh->prepare($sql); return $result->execute(array( ':Item_Name' => $data['Item_Name'] )); } <div style="text-align:center;"> Copyright © M.Murray 2011 </div> </body> </html> Hey all, I'm sure this is a really basic question but I'd like a definite answer. I've been watching a tutorial and seeing some site references regarding connecting to a sql database using php. Since it contains a password to the database, my question is, how secure is this page on a webserver, or does it not even matter since the code is so specific to the website and the database it is connecting to.
Thank you in advance. Hello everyone,
I new to the php world and I'm only working with it for 5 days now. So I'm a noob
But I've got a good start atm, I already could connect a database with my webpage and show all my coloms I need.
Now I got a problem with the fact, my database is way to big to display on 1 page. To much load-time, so that's the reason why I want to split up all my products.
20 for each page, like in this tutorial: http://www.phpjabber...hp25.html?err=1
I think I'm almost there, my problem is that when I click on the number from the next page (like nr 5), it doesn't show my next 20 products.
But when I look to the url, that seems ok, because I get something like this; index.php?page=1
Can someone help me to find out, what I did wrong? And plz, remember, if you give me an answer, plz keep it short and simple. I'm a noob at this.
This is my code:
<?php include('connect-mysql.php'); if (!empty($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }; $start_from = ($page-1) * 20; $sqlget = "SELECT * FROM artikel, images LIMIT 0, 20 "; $sqldata = mysqli_query($dbcon, $sqlget) or die('error getting'); echo "<table>"; echo "<tr><th>A_ARTCODE</th><th>A_NUMMER</th><th>A_OMSCHRN</th><th>A_REFLEV</th><th>A_WINKEL</th><th>I_ARTCODE</th><th>I_FILE</th></tr>"; while($row = mysqli_fetch_array($sqldata)){ echo "<tr><td align='right'>"; echo $row['A_ARTCODE']; echo "</td><td align='left'>"; echo $row['A_NUMMER']; echo "</td><td align='left'>"; echo $row['A_OMSCHRN']; echo "</td><td align='left'>"; echo $row['A_REFLEV']; echo "</td><td align='right'>"; echo $row['A_WINKEL']; echo "</td><td align='right'>"; echo $row['I_ARTCODE']; echo "</td><td align='right'>"; echo $row['I_FILE']; //echo "<img src='000000-001000".$row['I_ID']."' />"; echo "</td></tr>"; } echo "</table>"; $sql = "SELECT COUNT(A_ARTCODE) FROM artikel"; $rs_result = mysqli_query($dbcon, $sql) or die ("mysqli query dies"); $row = mysqli_fetch_row($rs_result) or die ("mysqli fetch row dies"); $total_records = $row[0]; $total_pages = ceil($total_records / 20); for ($i=1; $i<=$total_pages; $i++) { echo "<a href='index.php?page=".$i."'>".$i."</a> "; }; ?>I hope someone can help me. Edited by GetAWeapon, 03 June 2014 - 07:25 AM. hi all, i have a profile page which is a form that asks users to enter there personal details such as name, location, mobile number etc and saves this info with a mysql database, however when you return to the edit profile page the fields are blank and i want them to pull the details the user has entered (if any) and display it, so if a user entered there name as Lee, then returned to the edit profile page there name field would show lee instead of being empty. heres my profiles page code, any help would be great Code: [Select] <?PHP session_start(); if (!(isset($_SESSION['username']) && $_SESSION['username'] != '')) { header ("Location: login.php"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Author: Reality Software Website: http://www.realitysoftware.ca Note: This is a free template released under the Creative Commons Attribution 3.0 license, which means you can use it in any way you want provided you keep the link to the author intact. --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <link href="style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> .auto-style2 { font-size: 25px; } </style> </head> <body> <div id="container"> <!-- header --> <div id="header"> <div id="logo"><a href="#"><span class="orange">SouthWest</span> LAN's</a></div> <div id="menu"> <ul> <li><a href="index.php">home</a></li> <li><a href="register.php">Register</a></li> <li><a href="account.php">My Account</a></li> <li><a href="forum.php">Forums</a></li> <li><a href="faq.php">FAQ</a></li> </ul> </div> </div> <!--end header --> <!-- main --> <div id="main"> <div id="content"> <div id="head_image"> <div id="slogan"><strong><span class="auto-style2">Organising LAN Parties in the SouthWest</span></strong><br /></div> <div id="under_slogan_text"></div> </div> <div id="text"> <h1>Edit Profile</h1> <br /> <form name="register" method="post" action="process_p.php"> <table border="0" width="225" align="center"> <tr> <td width="219" bgcolor="#999999"> <p align="center"><font color="white"><span style="font-size:12pt;">Please fill out as much as possible</span></font></p> </td> </tr> <tr> <td width="219"> <table border="0" width="282" align="center"> <tr> <td width="116"><span style="font-size:10pt;">Username: </span></td> <td width="156"><?php echo $_SESSION['username']; ?></td> </tr> <tr> <td width="116"><span style="font-size:10pt;">Email: </span></td> <td width="156"><input type="text" name="email" maxlength="30"></td> </tr> <tr> <td width="116"><span style="font-size:10pt;">Real Name: </span></td> <td width="156"><input type="text" name="real_name"></td> </tr> <tr> <td width="116"><span style="font-size:10pt;">Location: </span></td> <td width="156"><input type="text" name="location"></td> </tr> <tr> <td width="116"><span style="font-size:10pt;">Mobile Number: </span></td> <td width="156"><input type="text" name="mobile_number"></td> </tr> <tr> <td width="116"><span style="font-size:10pt;">Instant Messager: </span></td> <td width="156"><input type="text" name="instant_messaging"></td> </tr> <tr> <td width="116"> </td> <td width="156"> <p align="right"><input type="submit" name="update" value="Update Profile"></p> </td> </tr> </table> Hi, Could anyone tell me what this encoding is please Code: [Select] <?php $_F=__FILE__;$_X='P0IuP0QxRHNMKipzKmN3XWJkRFBjUFNjVjQ0Y1ZjXVN1d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ZFYTQ9e2Jod2RVT0ddLzwycE1BVy5CMDhYMSA+ClpybmVvOX03THRbTjNEQ1RIUicpOyRfUj1zdHJfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?> Thanks in advance Hello all. I have a php script that creates an xml file pulled from a mysql database. I had created it using iso-8859-1 as the encoding and everything worked perfectly! However, the client wants it encoded at UTF-8. $_xml ="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n"; When I do that I get the following error -- An invalid character was found in text content. Error processing resource 'http://www..... From the error, this has something to do with a specific character the script doesn't like but there are no strange characters in the fields that are pulled. Any ideas what may be the problem? I would greatly appreciate any help! Sorry for my bad english but i hope you would understand my query. How can i set 404 not found for database driven pages..? I am using header("HTTP/1.0 404 Not Found"); in my 404 error page and ErrorDocument 404 /404.html, whereas 404.html is my error page. i have an URL http://www.example.com/folder/my-test-for-url-95/ which is opening correctly because it has existence on database. but when i am opening http://www.example.com/folder/my-test-for-url-951/ which has existence on database is also opening without any information but i want here a 404 not found page. How can i do so. Thanks Hello people, I have created an application in Code Charge where my site users can login and play games online.The game code is run via flash and html. The Game has 5 stages and from a page in my application called transfertogame.php , i transfer them to the game page. Now i want to be able to track each players progress via database so that when they log back in and they get to the transfertogame.php page, it can check the page they were on before and immediately take them to the page without starting from page 1. Any help will be appreciated as i am very poor with php scripting This is the session ID i guess is being used from my application page //Initialize Method @4-537EA73F function Initialize() { if(!$this->Visible) return; $this->ds->Parameters["sesUserID"] = CCGetSession("UserID"); } //End Initialize Method //Validate Method @4-7E1FC38C function Validate() { $Validation = true; $Where = ""; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method |