
kwstephenchan
Members-
Posts
64 -
Joined
-
Last visited
Everything posted by kwstephenchan
-
Hi everyone, I am new to MySql' full text search. I have gone through the tutorial and full text search topics in this forum but found not much specific to my questions here, hope that someone could give me some hints here regarding the following, thanks! 1. the full text index, is it created in advance or the script for creating the full text index is done along with the query script 2. do I need to create full text index on multiple table if I want to search multiple table, and how do I link them together 3. from the forum, someone mentioned that full text search is for English only and not much use for other languages, is that true?? Stephen
-
Hi Joe, I don't know why but it works now. This is the scenario, in caze, it may be useful to you. 1. server is installed with big5 XP 2. Dreamweaver preference char set is big 5 3. defined in meta content as big 5 All the Chinese character displayed ok but when I put these Chinese characters (cut and paste) into an external file, and then call this external file from the main script, they all turned out to be funny characters. I tested the program by inserting new Chinese characters into the script AND the external program, the Chinese character from the main script was displayed ok but not those from the external program. I later checked the external program and found that those Chinese characters in the external program were all funny characters (it was not originally and it was not when I inserted new Chinese characters in it for testing). So I re-type those Chinese characters in the external program, and tested it again, this time, it works fine (really don't know why) Hope this may be useful to you. In case you are using UTF-8, try big 5 or GB instead. Stephen
-
Joe, Thanks but didn't work. If I change the encoding, it just gives me some other funny characters. What I am confused is that the funny characters occurred only when I put them in the external program and call this external program from the main program. If I put them in the main program directly, it displays correctly. In addition, if I pull these characters from the database, it also displayed correctly. Is it possible that I cannot call this kind of display from an external program which means that I have to write this piece of codes in every page.
-
I have checked this already, it is big5 (one of the Chinese format). In addition, I have tried putting this in the external program and it still didn't work. Any idea what else could cause it?? The funny thing is that I can echo Chinese character in the program but when I put these character into an external program, include or require it in the program and call it to execute, it gives me all these funny character.
-
Hi everyone, I have this problem of displaying chinese characters: I can display chinese character in my php page if I echo them directly. But if I have these echo statement outside of this page (through include or require statement), I get all the funny characters. Does someone know what did I miss? (I also tried to include the charset command in the external file, but did not work) Thanks, Stephen
-
Hi everyone, I have read the full text search tutorial but need help on a few issues: 1. Can I use more than 1 table? How? Do I need to create the full index on each of the table? What happen if I want to search all these tables ggainst the search string? 2. Do I need to create the full text index when creating the database or the full text index is created along with the query code of the search program? Your help is greatly appreciated!! Stephen
-
accepting input from HTML embedded in PHP
kwstephenchan replied to kwstephenchan's topic in PHP Coding Help
Thanks for all the help! I finally figured out what happened! Because depending on the quantity, if the quantity is zero, I bar input for that field. For this reason,Ishould first check (silly me!) isset ($_POST['m_sq'] before moving on. I added the isset checking and it works fine now! Thanks, you guys have been great help! Stephen -
accepting input from HTML embedded in PHP
kwstephenchan replied to kwstephenchan's topic in PHP Coding Help
Thanks! I tried that but it still said undefined index, wonder why?? -
Hi everyone! I got this problem where I embedded the <input> html in a PHP statement. I used the Post method for the form. I called the second program to retrieve the input from the first form, but I could not retrieve the input information from the first form. However, I can retrieve those input written without PHP. I got this undefined index for the variable "m_sq" and "m_mq" but the input "A" was successfully passed. Can anyone help, please?? My codes are: <table width="800" border="0" align="center" cellspacing="0" cellpadding="0"> <tr> <td height="100"><form action="addtocart.php" method="post" name="form1"> <?php if ($row_col['sq']>0) { echo "<td><div align='center'><font size='2'> <input name=";echo "m_sq"; echo "type='text' id='m_sq' size='3'>";} else { echo "<td><div align='center'><font size='2' color=red> N/A";} echo "</font></div></td>"; ?> <?php if ($row_col['mq']>0) { echo "<td><div align='center'><font size='2'> <input name='m_mq' type='text' id='m_mq' size='3'>";} else { echo "<td><div align='center'><font size='2' color=red> N/A";} ?> </font></div> </td> <input type="submit" name="Submit" value="Add to Cart"> <input type="reset" name="Submit2" value="Reset"> <input type="hidden" name="A" value="Add"> <input type="hidden" name="MM_insert" value="form1"> </td> </tr> </table> BTW. I found it tricky to embed HTML in PHP especially when dealing with those enclosing with single or double quote, can someone give me hints on doing this, thanks! Stephen
-
Just can't figure out why this doesn't work
kwstephenchan replied to Cannibal_Monkey's topic in PHP Coding Help
don't know if you got the else if right, else if should be coded as elseif $b = 1; $c = 1; if ($b == $c) { $a = "They are equal"; } elseif ($b <> $c) { $a = "They are not equal"; } echo $a; -
need help on uncontrollable Header function
kwstephenchan replied to kwstephenchan's topic in PHP Coding Help
[!--quoteo(post=360808:date=Apr 2 2006, 12:21 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Apr 2 2006, 12:21 PM) [snapback]360808[/snapback][/div][div class=\'quotemain\'][!--quotec--] You should only be doing the check and the redirect if the form has been submitted. Change your code to be something like this: [code]<?php if(!isset($_POST['submitf'])) { ?> <form name="form1" method="post" action=""> <p>login (email): <input type="text" name="em"> <input name="pass1" type="password"> <input name="submitf" type="submit"> <input name="resetf" type="reset"> </p> </form> <?php }else { // accept input for user name – in the format of email $uname=$_POST["em"]; // determine redirection destination depending on email input by user if ($uname=="[email protected]") $newloc="abc.php"; else $newloc="123.php"; // redirect to new location header("location: $newloc"); } ?>[/code] Ken [/quote] Hi Ken and Zanus. Thanks for helping. After I checked for submit status, it works. Zanus, I did not get the modify error message, because I have put in the ob_start() at the very beginning for buffering. I believe this is only available after PHP4. Stephen -
Hi evereyone! I got the following simple code. Everytime I pre-run it, it goes directly to the Header function without asking for input (it does if I commented out the Header function), can anyone help and tell me what Have I done wrong, please! Ob_start() <p> </p> <form name="form1" method="post" action=""> <p>login (email): <input type="text" name="em"> <input name="pass1" type="password"> <input name="submitf" type="submit"> <input name="resetf" type="reset"> </p> </form> <p> </p> <?php // accept input for user name – in the format of email $uname=$_POST["em"]; // determine redirection destination depending on email input by user if ($uname=="[email protected]") $newloc="abc.php"; else $newloc="123.php"; // redirect to new location header("location: $newloc"); ?> ob_end_flush() Thanks and appreciated!!