everisk
Members-
Posts
95 -
Joined
-
Last visited
Never
Everything posted by everisk
-
It is just 2 Thai characters. I post the form data via AJAX and echo it to get "%u0E19%u0E32". It is encoded but I just couldn't figure out how to decode it or what kind of encoding that is.
-
I pass 2 Thai characters via AJAX (jQuery) and got %u0E19%u0E32. I have no idea how to decode it. Any idea is great appreciated. Thanks!
-
Oh thanks! I just thought of the second 2 solutions but it's good to know the first solution too.
-
I have CSS like and i try to position the input box inside the big box with the top padding of 15px. However, with the below code the bigbox get stretched downwards by 15px and the background image is just repeated (I know this can be fix easily but I dont want to have the bigbox stretched). How do I position the input box 15px down from the top and the bigbox is still 49px? Thanks! <div id="bigbox" style="height: 49px; background-image:url(../images/bigbox_bg.jpg); padding-top:15px;"> <input name="input_box" type="text" size="50" maxlength="250"> </div>
-
Yep, that's right. I plan to embed it with image link but no clue on how to retrieve info from Outlook.
-
If you want to read line by line you can $fd = fopen ($file_names, "r"); while (!feof ($fd)) { $buffer = fgets($fd, 1024); $sql = "INSERT INTO `forum` SET `username`='$buffer' "; $result = mysql_query($sql) or die(mysql_error()); } fclose ($fd);
-
Hi, I'm trying to write a small php app (which will be embeded in email) that needs to know which version of MS Outlook is used to open the email. I'm been trying to use user agent but it doesn't seem to be different from web agent at all ???. I notice that when send email from Outlook, it adds X-Mailer: xxxx <-- this is the outlook version. If I can access to this, it would be awesome but not sure if it's possible. Any help is greatly appreciated. Thanks in advance!
-
Thank you! bibby and Ken2k7. Got it working now.
-
copy content from text file to htm file using php
everisk replied to sandhya's topic in PHP Coding Help
How about echo html_entity_decode($theData); -
Hi, I have below code var c = '<p>Test [Name]</p> <p> [Time]</p> <p>[Link]</p> <p>List</p>'; c = c.replace(/>(\s+|\t)</, "><"); alert(c); It looks like replace only replace the first occurance of the RegEx match. Isn't it suppose to replace all? Can anyone please tell me how do I get it to replace all occurance of RegEx match? Thanks a lot!
-
It's called 'Regular Expression' or RegEx and i think you could modify it a bit to get it to work with both files preg_match_all("~(AC[0-9]{6})~", $text, $matches); This will match everything that starts with AC and follow by 6 numbers. Trying print_r($matches) to see the result.
-
Launch file in background and then redirect page
everisk replied to everisk's topic in PHP Coding Help
ah ok ..thanks! neil.johnson -
Launch file in background and then redirect page
everisk replied to everisk's topic in PHP Coding Help
I have done a bit more research and found that exec() might not work on some windows environment I tried with cURL and get it working to a certain extent, but then the problem is that my script checks session id for security and the page that gets called by cURL does NOT retain the same session id as the parent script. Is there any way to force cURL to use the same session id as the parent script? I tried passing the session id and set it in the target script before checking it, but the script just halts. -
Launch file in background and then redirect page
everisk replied to everisk's topic in PHP Coding Help
Thanks! This works on all OS? I did some search and it looks like it might not work on Windows? I have never used exec() before and I need the script to work on both Windows and Unix. -
If you can read the text file into PHP already then I'd would use RegEx to get the matric no. Something like (regex not tested) preg_match_all("~(Matric No.(\s*)(AC[0-9]{6})~", $text, $matches); If your text file is big then it may be better to read it line by line to save memory. more info: http://th.php.net/manual/en/function.preg-match-all.php
-
Hello, Now I'm using iframe to launch the script in background and meta redirect to redirect page. However, the problem is it seems like the system has to wait for background_script to completely loaded before redirecting. Is there any other way to do this? Any help is greatly appreciated. Thanks! echo '<iframe src="background_script.php" width="0" height="0"></iframe>'; echo '<meta http-equiv="Refresh" content="0; url=../context/redirect-to.php">';
-
oh wow, thank you~!
-
Hi, I'm trying to match data with 2 percent sign in front and after, in the middle it can be just capital letters or capital letters with numbers, i tried with /[(%){2}(A-Z0-9)(%){2}]/ and it doesn't work Any help would be greatly appreciated. Thank you !
-
Thank you. Unfortunately I dont post to the same script but I guess I can use the same approach. Thanks!
-
Hi, I have a script where after form is submitted a series of check is done with PHP ( has to work with database so cannot check with javascript). If PHP found an error it should redirect back to the form and still keep the user entered value. How do I do that? My plan is just redirecting back with header:location but with this method, form value just got lost. Any help would be greatly appreciated. Thanks!
-
Any other idea would be appreciated! Thanks.
-
Thank you for your reply! A few questions, though. How could the session be available to another instance of the script? I thought session is tie with session id and i think if i run the script in cron, new session id is being created. And suppose I send 100K of emails the session variable will get soo big?!
-
Hi, I have a script that send a lot of emails from database and cron to make sure that it continues to send even after the script time out or stop running for some reason. However, how do I make sure that the email will not get sent twice? I think it is possible that the script is still running and when cron kicks in the same email might be fetch from database and that person will get the email message twice? Although I might delete the email address after it has been sent to but I think it is still possible that before it was successfully sent to, the cron kicks in and fetch the same email because the sending hasn't finished and therefore the email address hasn't been deleted. I'm still at the concept part so any thoughts would be greatly aprreciated. Thanks!
-
Hi, I have a script where values are passed to another processing script via AJAX. The processing script may takes a few minutes to finish therefore I'd like to return a response to user before process finishes. I have done this is flash form but now with AJAX my code doesn't seem to work. My code is below. Thanks! $response = "Processing is finished"; ob_end_clean(); ob_start(); header("Connection: close"); echo $response; $size = ob_get_length(); header("Content-Length: $size"); ob_end_flush(); flush(); /// long process goes after this ///