Jump to content

mabog

Members
  • Posts

    38
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mabog's Achievements

Member

Member (2/5)

0

Reputation

  1. Found the problem. Data (where those 0As are) is a tab-delimited text file created by excel. That line feed is confusing file handling when trying to get data one row at a time with fgets(). It acts like 0A is a new row.. Tried to add ini_set('auto_detect_line_endings', true); before fopen(), but no change. So those characters would be needed to remove BEFORE the file is opened. And that, I think, is impossible since files might be quite big.. Going through the file one character at a time for 0A's, is slow... So it's easier to ask users to remove word warp (that, i belive, is creating 0As) from the excel file before uploading it to my page. No can do.
  2. Hello. Trying to get rid a line feed which is coming from a excel cell which has Text and a line feed after that word. After the excel file has been saved-as tab-delimited, that text transforms to this: "Text" That line feed is between t and the last double-quote. Hex viewer shows: 22 54 65 78 74 0A 22 so it must be that 0A. I have tried with trim() and with str_replace("\x0A","",$data) but nothing (like \r or \n) works. How do I get rid of that hidden character? Is that \x0A correct?
  3. But I don't want to assign width to the middle <td>. The first and last <td> contains always short text, but the middle one just sometimes. I want the middle one to disappear when it's empty (= looks like there's only two <td>). Has anyone created a site where browsing with explorer is totally prevented.....? I could do that. Would give more time to actually improve the site..........
  4. I totally agree! But I can't prevent other people to browse my site with it... I like to design websites, but trying to make everything work correctly on explorer is very very frustrating Anyway, I solved the alignment problem (page's other code was affecting it) but the widths are still not correct. Here'a a sample page Which is looking like this to me: I need those smaller tables to be 30 & 50 pixels wide but the center one to be a "flexible" one. Does anyone have any clue how to fix it? Maybe it's just not possible....
  5. Why the "R w50" text is not on the right?? How can I fix it? Also the first "w30" has not correct width.........? <table border=1 cellpadding=5 cellspacing=0> <tr> <td style=\"width:30px;\">w30</td> <td>n</td> <td style=\"text-align:right; width:50px;\">R w50</td> </tr> <tr> <td colspan=3> <table border=1 cellpadding=5 cellspacing=0 bordercolor=red width=100%> <td style=\"width:30px;\">w30</td> <td>n n n n n n n n n n n n n n n n n n n</td> <td style=\"text-align:right; width:50px;\">R w50</td> </table> </td> </tr> </table>
  6. Problem solved. The server hosting company had implemented somekind of additional cache... Clearly wasn't working like it should so they removed it. Thanks for the help.
  7. Ok, the problem is seen in this simple code: <? // thispage2.php echo date('d.m.Y H:m:s'); echo "<br><a href=\"thispage2.php\">Reload</a>"; ?> I think the date should be updated every time the 'Reload' link is clicked? Well, it's not.. If I keep clicking the link continuously, the date is updated in every 19 seconds sharp! This has little to do with PHP anymore, but maybe someone could have an idea what causes this glich?
  8. Sometimes nothing happens (button stays, number is the same) and sometimes the number is increased by one. But the mysql table is updated EVERY time. If I click "refresh page" AFTER nothing was happened, the number is increased by one. I've made more investigation and: That example page is working on the Explorer! And with Chrome. But not with Firefox! (Firefox now updated to 4.01) With Explorer and Chrome the number is increasing every time I click the button. On my site, the problem is happening with every browser! Ok, that example code is not 100% equally constructed like a page on my site, but it should be close enough. BUT it is strange thing also that my site's users haven't (yet..) reported any problems about this... so could this be happening in my end only? I've tried with firefox, explorer, chorme, with three different computers (xp, vista). But the problem stays.
  9. You're right, my explanation was a little vague, sorry. This shows my problem. It should echo $num +1 every time the button is clicked, but it's not. $num will increase ONLY when "refresh page" from the browser is clicked. <? /* CREATE TABLE `numbers` ( `num` TINYINT( 3 ) DEFAULT '0' ); INSERT INTO `numbers` ( `num` ) VALUES ( '1' ); */ $db = mysql_connect("localhost", "username", "password"]) or die(mysql_error($db)); $sql_vars["db"] = $db; mysql_select_db("dbname"], $db) or die(mysql_error($db)); switch($action) { case "increase": mysql_query("update numbers set num=".(1+$_POST["newnum"])); $url="thispage.php"; header("Location: ".$url); die(); break; } $num=mysql_result(mysql_query("select num from numbers"),0); echo $num; echo "<form action=\"thispage.php?action=increase\" method=\"POST\">"; echo "<input type=\"submit\" value=\"increase\">"; echo "<input name=\"newnum\" value=\"".$num."\" type=\"hidden\">"; echo "</form>"; ?>
  10. Hello! My server hosting company has updated PHP from 4 to 5 version, and now the header function doesn't work very well anymore. It does load the new page everytime, like it should, but the data is not always refreshed. Not until I click "reload current page" from the browser. I'm using Firefox 3.6.3. Here's the code which worked just fine few days ago: $url="thepage.php"; header("Location: ".$url); die(); I tried something like this, but that doesn't work either: $url="thepage.php"; header("Refresh: 0; url=".$url); die(); This is really nasty problem... How can I fix it?
  11. Preg matching is killing me... $string1="Here: http://www.example.com"; $string2="Here: http://www.example.com check that."; How can I match that address only in both cases? I have this: preg_match_all("/[hH][tT][tT][pP]\:\/\/.*\s/",$string,$matches); print_r($matches); Which matches only string 2 AND with a space at the end. And this: preg_match_all("/[hH][tT][tT][pP]\:\/\/.*.(\s|\b)/",$string,$matches); print_r($matches); Which matchs both BUT with "check that" text at the end! Is the trick to match that link as one word? How?
  12. Can get this to work.. please help. $string="Click me";$splitted=preg_split("/\/",$string);print_r($splitted); preg is WITHOUT http:// forum added it just url= I need to extract this: "Click me"
  13. I need to search short words, like "4 x 4". Actually it's should act like one word, five letters long. But cannot find the right syntax.. Is it even possible? Query is now like this: SELECT * FROM car WHERE MATCH ( car.name ) AGAINST ( "\"4 x 4\"" IN BOOLEAN MODE ) CREATE TABLE `car` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '<empty>', PRIMARY KEY (`id`), FULLTEXT KEY `name` (`name`) ) ; INSERT INTO `car` (`id`, `name`) VALUES (1, '4 x 4');
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.