PHP - Internet Explorer Converting Spaces Into Underscores
Hi, I have a problem with Internet Explorer converting spaces into underscores:
The problem occurs using PHPRtfLite. When I run the script I want the file name to contain spaces, however in Internet Explorer these spaces are converted into underscores. This does not happen in ff, chrome, safari or opera. Any help on how to fix this would be much appreciated as I am stuck. Thanks. Joe p.s. Here is how the file name is created $filename = "Mysite - ".$u-ID."' (".$user_name.").rtf"; Similar TutorialsHi, as usual there is a problem ONLY with one browser... IE (any version). Please check the webpage & notice the space between the Header buttons. I can't find the PROBLEM!!! Please help!! Thanks in advance.. Hi All! First post here - I'm a bit of a self taught PHP junkie I'm having some issues with the following php/MySQL code. The issue is with Internet Explorer (surprise, surprise) I have setup an if statement so that the long description field in the form comes up as a text area (based on the max-length property of the mySQL field.), while the shorter fields come up as text fields. The issue is that in IE, none of the shorter fields preceding the Long Description Text Field show up - ie. the form is lacking a couple of necessary fields. Works perfectly well in Firefox. <form id="addprod" name="addprod" action="" method="get" enctype="multipart/form-data"> <?php require_once($_SERVER['DOCUMENT_ROOT'].'/resources/db/viewer_connect.php'); $table = 'products'; $fieldQuery = "SELECT * from $table"; $result = mysql_db_query($dbname,$fieldQuery) or die('<span class="body_text">Query Error: '.mysql_error().'</span>'); $i = 0; $prInfo = array('PROD_ID'=>'Product ID', 'PROD_NAME'=>'Product Name', 'PROD_DESC_SHORT'=>'Product Description (Short)', 'PROD_DESC_LONG'=>'Product Description (Long)', 'MODEL_1'=>'Model 1', 'MODEL_2'=>'Model 2', 'MODEL_3'=>'Model 3', 'MODEL_4'=>'Model 4', 'MODEL_5'=>'Model 5', 'RRP_1'=>'Model 1 RRP($)', 'RRP_2'=>'Model 2 RRP($)', 'RRP_3'=>'Model 3 RRP($)', 'RRP_4'=>'Model 4 RRP($)', 'RRP_5'=>'Model 5 RRP($)', 'PROD_IMG'=>'Main Image', 'IMAGE_2'=>'Image 2', 'IMAGE_3'=>'Image 3'); while ($i < mysql_num_fields($result)) { $meta = mysql_fetch_field($result, $i); if (!$meta) { echo "No information available<br />\n"; } if($meta->max_length<=256){ if($meta->name=='PROD_IMG'||$meta->name=='IMAGE_2'||$meta->name=='IMAGE_3'){ echo '<p class="body_text"><label for="'.$meta->name.'">'.$prInfo[$meta->name].':<input name="'.$meta->name.'" type="file" size="50" maxlength="'.$meta->max_length.'" /></label></p>'; } else{ echo '<p class="body_text"><label for="'.$meta->name.'">'.$prInfo[$meta->name].':<input name="'.$meta->name.'" type="text" size="50" maxlength="'.$meta->max_length.'" /></label></p>'; } } else{ echo '<p class="body_text" style="line-height:150px; vertical-align:top;"><label for="'.$meta->name.'">'.$prInfo[$meta->name].':<textarea name="'.$meta->name.'" cols="50" rows="10" /></p>'; } $i++; } mysql_free_result($result); ?> <p class="body_text"><input type="submit" value="Add New Record" /><input type="reset" value="Clear Form" /></p> </form> Any thoughts would be awesome!! Thanks in advance, Tim Well, my page contains a URL like file.php?userid=1&pass=passwordhashblablabla. I try to open the page on opera, mozilla, safari, google chrome and so browsers and it works fine. I get the message that id/pw match and user has logged in successfully. However, when I go to THE SAME url on IE, i get message that id/pw do not match. URL is still the same, history is cleaned... Thanks in advance. Hello... I'm working on a webpage (http://66.119.8.164/freedownloads.php) that pulls from an rss feed (http://www.moorelife.org/rss/FreeDownloads.xml). Please keep in mind that I'm working on content, not design. It's a very long page, currently. I want to have links on a sidebar that will allow sorting and filtering, based on <category>. I got the idea from, get this, Internet Explorer's built-in rss reader. It's great. I have a section of the page populating with SimpleXMLElement (that's where the case cover images and titles are). Above that is an alphabetic listing of all those entries populated by SimpleDOM's sortedXPath. Between those two are a few category links that use ajax to overwrite the section pulled with SimpleXMLElement. Now, I don't have any idea if I'm even doing this in an intelligent manner. As a matter of fact, I'm sure it's very far away from resourceful code. It's just what I have gotten to work when other options didn't work. Now, on to the problem. The code, below, is the php file (http://66.119.8.164/include/getrss.php) that ajax uses to overwrite the original list. Code: [Select] <?php //get the category from URL $category = $_GET["category"]; $xml = "http://www.moorelife.org/rss/FreeDownloads.xml"; $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); $item = $xmlDoc->getElementsByTagName('item'); for ($i=0; $i<=5; $i++) { $item_title = $item->item($i)->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue; $item_category = $item->item($i)->getElementsByTagName('category')->item(0)->childNodes->item(0)->nodeValue; echo "<p>".$item_title."</p>"; echo "<p>".$item_category."</p>"; } ?> How do I only show the entries where $catagory match <category>? JJ This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=318213.0 Hello everyone, I'm new here first post, but there's a weirdness in code that i need to share, First of all, I know everyone who knows PHP/MYSQL will say the same thing... Server side code cannot be broken by a browser, especially by client side coding. I agree!!! That may be the case here too, but I have encountered one of the weirdest code ever and the client side code is causing an unexpected result in PHP/MYSQL, and only in Internet Explorer. Unexplainable, and I am seeking for an answer. After hours of trouble shooting I finally targeted the the trouble code... and it's CSS, and it's affecting a MYSQL line of code in PHP... #somediv { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''); } ... anyways let me explain how the code should run and the problem... in one page a variable passed in the URL is being captured by PHP using the $_GET method, if that variable is empty PHP runs a code which updates a MYSQL database. That works fine, and as expected, except in INTERNET EXPLORER. On that same page, a css file which is to be included with the output html to the browser contains the above line of css too. Now in every other browser that code works as expected, if the variable is NOT empty, update the database and then output the html code. In IE the database gets updated no matter what, whether the variable is empty of not. Now the its only the mysql code inside the IF statement that get affected, because for troubleshooting purposes I have put echo statements inside the code, to catch the problem, and the echo statements work as should, just not the mysql update statement. Someone care to shed some light into this mystery? Like many parents, I'm challenged with keeping my kids from browsing the evil parts of the internet. My son is 11 and my wife caught him deleting IE history the other day. The computer he uses is a Windows 8.1 laptop, and it is not Pro. How can i let him use internet explorer on his own user but keep him from tampering with any of the history ( or settings for that matter)? Is there a better solution? I found some internet history logging software online, but I didn't feel comfortable with the source, and fear it may contain viruses or other malware. I have been banging my head for quite a number of hours on this.........I am getting the below error with firefox 7 or chrome but NOT with IE Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/unlockth/public_html/motorola/insertmoto.php on line 35 Here is the code.......pls can anyone help me? <?php $userip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $name = $_POST['name'] ; $email = $_POST['email'] ; $phone = $_POST['phone'] ; $operator = $_POST['operator'] ; $imei = $_POST['imei'] ; $todayis = date("l, F j, Y, g:i a") ; @mail( "xxx@xxx.com", "ORDER SUBMISSION", $message = " $userip $message = $todayis Name: $name Email: $email Phone Model: $phone Phone Operator: $operator Phone Imei: $imei", "From: MOTOROLA SUBMISSION>"); ?> <? $id = $_POST['id']; include "/home/unlockth/password.php"; mysql_select_db("unlockth_unlocking",$db); mysql_query("INSERT INTO custdetails VALUES ('','$name','$email','$phone','$operator','$imei')"); $insertid = mysql_insert_id(); include "/home/unlockth/password.php"; mysql_select_db("unlockth_unlocking",$db); $getdata = mysql_query("SELECT * FROM motorola WHERE id=$id", $db); $row = mysql_fetch_array($getdata); $title = $row["title"]; $price_1 = $row["price_1"]; $price_2 = $row["price_2"]; $price_3 = $row["price_3"]; $imageaddr = $row["imageaddr"]; $description = $row["description"]; $keywords = $row["keywords"]; $time = $row["time"]; include '/home/unlockth/public_html/motorola/outputmotocode.php';?> This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=346255.0 So I am trying to download an image created with my php script. I use the following for the download: Code: [Select] <?php session_start(); $filename = $_SESSION['imgOut']; header('Content-type: application/octet-stream'); header('Content-Disposition: attachment; filename='.$filename ); ?> The file downloads however instead of downloading "example.jpg" from the /temp folder , it downloads "temp_example.jpg" which of course is an empty file. I am sure I am approaching this the wrong way, any suggestions? Sample array: array('one','two','three','_zero'); How could I sort this array so that _zero moves to the front.. Any items that begin with an underscore should be moved to the front of the array to get something like so: _zero, one, two, three Thanks Say I have this array: Code: [Select] <?php $array = array('one' => array(), 'two' => array(), '_three' => array()); ?> How could I sort that array so it ends up like so: Code: [Select] Array ( [_three] => Array ( ) [one] => Array ( ) [two] => Array ( ) ) Thanks!! I made a form, like guestbook, and i dont wonna to write in mysql if in comment is just 1 or more spaces, no letters or numbers or chars, just space, how can i fix that? This doesn't work: Code: [Select] <style type="text/css" media="all">@import url(style/'.$skin.'.css);</style> $skin is = "Sky Blue"; If $skin is = "Sky Blue"; this works: Code: [Select] <link rel="stylesheet" type="text/css" href="style/Sky Blue.css"> It's because @IMPORTURL, Is there a php function that wraps a &20 for a space so it works on my $skin? ok so when my code dipsplays i get the spaces i add in the db but when i updae it dispalys this rnrnrn and its all together Code Code: [Select] <?php include "scripts/connect.php"; if(isset($_GET['edit'])){ $newid = $_GET['edit']; $query = mysql_query("SELECT * FROM news WHERE id='$newid' LIMIT 1"); $rows = mysql_fetch_array($query); $newstitle = $rows['title']; $newsby = $rows['by']; $newsbody = $rows['body']; } if(isset($_POST['saveedit'])){ $newid = mysql_real_escape_string($_POST['saveedit']); $newstitle = mysql_real_escape_string($_POST['title']); $newsby = mysql_real_escape_string($_POST['by']); $newsbody = mysql_real_escape_string($_POST['body']); if ($newstitle && $newsby && $newsbody){ $query = mysql_query("UPDATE news SET title='$newstitle', 'by'='$newsby', body='$newsbody' WHERE id='$newid'") or die(mysql_error()); echo "UPDATE SUCCESFULLY!"; }else $msg = "<font color=red>YOU DID NOT FILL ALL OF THEM IN!</font>"; } ?> <form action='enews.php' method='POST'> <table> <tr> <td></td> <td><?php echo "$msg"; ?></td> </tr> <tr> <td>Article Title</td> <td><input type='text' name='title' size='45' value='<?php echo $newstitle; ?>'/></td> </tr> <tr> <td>By:</td> <td><input type='text' name='by' size='30' value='<?php echo $newsby; ?>' /></td> </tr> <tr> <td>Article Body</td> <td><textarea cols='45' rows='25' name='body'><?php echo stripslashes($newsbody); ?></textarea></td> </tr> <tr> <td><input type='hidden' name='saveedit' value='<?php echo $newid; ?>'/></td> <td><input type='submit' name='updatebtn' value='Update' /></td> </tr> </table> </form> </div> echo $first$last; how would i add a space it comes out like this JoeJackson i want it like this Joe Jackson How can I block a text that contains only spaces? Right now I have done if ($body == "") { die("<font color='red'><font size='15'><strong><center>Your post did not contain any text!"); } But that's extremely insufficient, as any user can easily post " " Any ideas? I have a form which has a drop down menu select box, which retrives the makes of cars from a database, which once clicked submit will go to another page post that info. Then a if statment says if the variable that has been posted == a certain word that matches the one in the database then display content. However, my issue is when I have a car make such as "Land Rover" saved in the database as typed it just comes back with the final else statement. In the 1st section I have included the form which is posting the information across and in the second I have the if statement. Any ideas of how to get around / make this work? [ <form method="post" action="details.php" enctype="multipart/form-data"> <table class="search_nav"> <tr> <td> <select name="manufacture" id="manufacture"> <option value=" " selected="selected">Car Manufactures </option> '; $query = "SELECT DISTINCT make FROM cars ORDER BY make ASC"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); while ($row = @ mysql_fetch_array($result)) { print ' <option value='.$row["make"].'>'.$row["make"].'</option> '; } print ' </select> </td> </tr> <tr> <td colspan="2"> <input type="image" src="images/go.gif" alt="Go" name="submit" id="submit" value="Submit"/> </td> </tr> </table> </form> ] [ if ($manufactures == "Land Rover") { echo "test"; } ] I'm looking for a function that will check a string for letters and spaces...boolean preferibly How do I get directory names to display with spaces. My script sticks them into arrays just fine, but when trying to echo from a checkbox selection, it only displays the first word. How would I fix this? |