- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 1
- Downvoting Members
- 2
66 Posted Topics
I have a question about php mail() function. This function allows multiple recipients that separated by comma, for example: $mailto="a@test.com,b@test.com,c@test.com"; mail($mailto,$subject,$message,$headers); If all recipients address are correct, no problem, mail can be sent properly. However if one address is no longer valid (for instance he leave company), this mail function … | |
What's the difference between "include", "include_once", "require", "require_once"? thanks. | |
I created a from which includes a textarea, this data will be saved to mysql, when I retrieve it, I want to only display the first two lines of this textarea data(ignore the rest), and only limit to text format(not html), how can I do that? If I continue to … | |
I have a file server in the network, I try to search for the file contents based on search keywords (this is not only search for file name), need to search files like ".doc", ".pdf", ".html", is there an easy way to do that? for example I need to list … | |
Is there php function to remove the space inside the string? for example: $abcd="this is a test" I want to get the string: $abcd="thisisatest" How to do that? thanks. | |
I try to use PHP GD library to resize image to thumbnail size, however I found the small converted image has bad quality(distorted color), how can I improve the image quality by using PHP GD library: [code] $first=imagecreatefromjpeg($uploadfile); define(MAX_WIDTH, 180); define(MAX_HEIGHT, 135); $width = imagesx($first); $height = imagesy($first); $scale = … | |
In php mail() function, how can I send attachments? I didn't find parameter to do this. any help will be appreciated. | |
I turned on php Domxml module in php.ini and restart apache server, I can read domxml is enabled in phpinfo, however when I try to load XML file: $dom = DOMDocument::load($_FILES['file']['tmp_name']); it shows me the error message: Fatal error: Call to undefined function: load() in c:\program files\apache group\apache\htdocs\bom\tool_rev_import.php on line … ![]() | |
When I try to use MS SQL Server Enterprise Manager to create table, I typed column name, data type as "int", however the length of "int" is 4, that is fixed I cannot change, now the problem is I need to use this column as record ID, my database is … | |
I have a table for example: tb1 with data: [CODE]cse-12m cse-343k cse-mka cse-ptu cse-jpy[/CODE] How can I write a SELECT statement to retrieve data in one of these formats: 1) cse-three digits number 2) cse-p% and exclude other format data, any idea? | |
how can I pass GET url which contains character "?" to php file. for example I have url: [url]http://www.mysite.com/file1.php?string=file2.php?a1=1&a2=2&a3=3[/url] I want to pass all string "file2.php?a1=1&a2=2&a3=3" into file1.php now on file1.php, if I use $v=$_REQUEST['string']; echo "$v"; I only get file2.php?a1=1 it lost rest "a2=2&a3=3" how can I fix this … | |
I have one table in this format: [ICODE] Product Component --------------------------- A part1 A part2 B part1 B part4 A part3 C part5 D part1 [/ICODE] now I want to display product which components meet requested items, for example: I know component are "part1" and "part3", need to show product … | |
I need to manipulate two tables(in different DB) to print out data, what's the effective way to do that in php code? [ICODE] $conn = mssql_connect($intraserver, $intrauser, $intrapass); $db=mssql_select_db($intradb, $conn); $result0=mssql_query("select a from tb1");// in $db for ($i = 0; $i < @mssql_num_rows( $result0 ); ++$i) { $line = @mssql_fetch_row($result0); … | |
Is there a function in php to remove the duplicate string variables, for example there is "abcd,ab,cd,abc,abc", how to change it to "abcd,ab,cd,abc"?thanks. | |
I try to generate on-fly pdf files by php code, the pdf file will display the web page exactly the same as on browser, did some research but have no clue how to do that. The function: PDF_show_xy ( resource $p , string $text , float $x , float $y … ![]() | |
I have a table in MS SQL DB, the data was recorded with redundancy, is there an easy way to remove all but keep only one, for example: [ICODE]id name age dept --------------------------- 1 alan 20 A 2 william 23 B 2 william 23 B 3 mike 30 C 3 … | |
I am currently using MS SQL 2000 server as backend database for web site (written in php), now plan to switch DB to MS SQL 2008 Express, I have questions about this conversion: 1) Will MSSQL2008 support all sql statement that was written in MSSQL 2000? 2) I know SQL2008 … | |
I am planing to write a php script which can display time schedule bar, based on start/end date, and each project(see attached image, start/end date and project name are saved in database), the length of time bar should be flexible upon start/end date, I have no idea how to implement … | |
I have a MSSQL table that contains lots of duplicate records, is there a simple way to keep only one and remove all other duplicates? [CODE] mike M 60 mike M 60 mike M 60 [/CODE] I need only one record [CODE] mike M 60 [/CODE] | |
I try to copy and paste TAB delimited list into html text area, then save it to database, however when I retrieve it from DB, all TAB space are gone, does anyone can give me advice is there a way to keep these TAB? Thanks in advance. [CODE] test test … | |
I can run the following javascript code succefully in IE browser: <script language="JavaScript" type="text/JavaScript"> document.formname.submit(); </script> this javascript automatically submit the form when running the page. However I have problem in Firefox browser, it's stuck at this code (cannot submit form). Any idea what I need to modify so it … | |
I have a form text field called "field_0", and javascript code: [ICODE] <script language="javascript"> function test() { var a=document.form1.field_0.value; alert (a); } </script> <form name=form1 ....> <input type=text name=field_0> <input type=text name=field_1> <....onclick='javascript: test();'> </form> [/ICODE] if I run this, it pops up correct message box with the "field_0" value. … | |
how can I replace who string with certain beginning and ending, for example I have string: abc........xyz I want to replace this string with "this is a test", no matter what text in between, only "abc" and "xyz" are fixed. abc123xyz-->this is a test abcd1234xyz-->this is a test any idea? | |
How can I get future date by php date() function, for example today is 11/13/2007, I want to get the date after 60 days. Any advice will be appreciated. ![]() | |
I have a simple php file for example: [CODE] <? header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=file123.xls"); header("Pragma: no-cache"); header("Expires: 0"); print "test"; ?> [/CODE] What I want to do is export php result and save it in excel file. If I run this from web browser like IE,firefox, I have no … | |
I have a question about how to manipulate php string. For example, I have a text string: $text=" ---<updated:12/20/06>--- this is 2nd entry ---<updated:12/19/06>--- this is 1st entry "; Now if I want to remove "---<updated:XX/XX/XX>---" and only display: this is 2nd entry this is 1st entry how can I … | |
In html page I have two forms: [html]<form name=fm1 method=post action=aaa.html> <input type=text name=a1> <textarea name=a2></textarea> <input type=submit> </form> <form name=fm2 method=post action=bbb.html> <input type=text name=b1> <input type=submit> </form>[/html] Now the question is if I submit "fm2", is it possible to also submit the text area which is in "fm1"? … | |
I try to download IE7 and install it on my machine, however my pc is running on windows 2000, and there is no download version for win2000, does it mean IE7 cannot run on win2000? Thanks for any comment. | |
I have two tables: tb1: ID USERNAME 1 u11 2 u12 3 u13 tb2: ID USERNAME 2 u12 My question is how to retrieve records from tb1 and exclude one that is in tb2, so the result will be: ID USERNAME 1 u11 3 u13 Any comment? Thanks in advance. | |
I have a question about the possible string match in sql statement, for example I have variable "$val=abc", I can write: [CODE] SELECT * FROM table WHERE field like '%$val%' [/CODE] this will list all recoreds that the field contains sub-string "abc". Now the question is: if I have a … | |
I have php code that retrieve data from mysql DB, and print it in html table. [PHP]<? print "<table>"; $result=mysql_query("select fd1,fd2,fd3 from tbl"); for ($i = 0; $i < mysql_num_rows($result); ++$i) { $line = mysql_fetch_row($result); print "<tr><td>$line[0]</td><td>$line[1]</td><td>$line[2]</td></tr>"; } print "</table>"; ?>[/PHP] I have no problem to implement above code, this … | |
By defalult the text in input box is left aligned, is it possble to have it right aligned? The reason to do this is I have a list of input box vertically, to input the price for each item, I want to show price(with decimal) right aligned so it looks … | |
I am wondering how to print the html table background color on printer, for example I have html table: <table border="2"> <tr> <td bgcolor="#3333FF"> </td> <td> </td> <td> </td> </tr> </table> From browser I can see backgound color, however if I print it out, the color is gone, is there a way to … | |
I want to know is it possible to generate PDF file automatically at the background, I have adobe acrobat installed, usually this application is installed at client side, they can save as pdf file at local machine, however I want create pdf file from client side and save it to … | |
product transaction date -------------------------------------- 1 06/07/2006 2 06/05/2006 2 06/10/2006 3 06/09/2006 I have a table like above, now I want to retrieve the latest transaction date for each product, so the result should be: product transaction date -------------------------------------- 1 06/07/2006 2 06/10/2006 3 06/09/2006 I try to use statement: … | |
I have the code:[code] <form method="post" action="abc.php"> <input type="submit" name="sb1" value="sb1"> //<----LINE1 <input type="image" src="sample.jpg" name="sb2" value="sb2"> //<---LINE2 </form> [/code] Now the question is: I can use submit button to submit "sb1", but if I try to submit image "sample.jpg", I cannot retrieve data "sb2". Anyone knows why? thanks. | |
I try to set cookie values from mysql DB, I have the code: [code] $result = mysql_query("select ID from table"); while ($thisrow=mysql_fetch_row($result)) { $gname="name_".$i; setcookie ("$gname", $thisrow[0]); $i++; } [/code] Now the strange thing is, if the number of ID is less than 16, script runs without any issue, I … | |
In MSSQL "SQL server enterprise manager"(client side), I run query and application display record list, if I want to set a cell to "<NULL>" value, how can I do that with the hot key? thanks for any answer. | |
I have two tables: tb1: Name Email Location ----------------------------------- user1 email1 address1 user2 email2 address2 user3 email3 address3 ----------------------------------- tb2: Group Email ----------------------------------- group1 email1,email2 group2 email4 group3 email5,email6 ----------------------------------- Now I want to join these two tables, to display the usernames who are listed in table 2, with keyword … | |
If the items in <select> drop down menu are populated from mysql DB, like: [code] <? echo "<select name=ptype>"; echo "<option value=\"\">------Select------</option>"; for ($i = 0; $i < mssql_num_rows( $result0 ); ++$i) { $line = mssql_fetch_row($result0); echo "<option value=$line[0]>$line[1]</option>"; } echo "</select>"; ?> [/code] Now I want to submit this … | |
I want to use PHP mail() function to send email to hundreds of users, in mail function I can set mail list like: $sendto="user1@abcd.com,user2@xyz.com,user3@yahoo.com,....."; But in this way when user receives this email, he can see all the email recipients at the top, I want to hide this info, is … | |
I would like to know how I can backup Mysql tables from hosting server to my local pc? I don't want to use phpMyAdmin, is there some simple commands to do that(I use PHP)? and how to restore it back to hosting server? I assume it will use csv file. … | |
If I have an array $abc=[0,0,0,1,0,2]; how to change it to $abc=[1,2]; (remove all 0), is there php function can handle that? thanks. | |
A simple question. I have integer variable $a=2, how can I display it in string format: "SN0002" with 4 '0' inserted? thanks. | |
I have date value saved in Mysql DB, with format "dd.mm.yyyy", now I want to delete all records that date is older than 10 days from today, how can I do that in php? is there php function can calculate previous date? thanks for any help. | |
If I use form default "grey submit" button, I can define value like: <input type="submit" name="button1" value="submit"> However if I use image instead of "grey button", how can I define value? <input type="image" name="button1" src="img1.jpg"> As I have multiple submit image buttons, so I need to submit its own value … | |
In php, is there a function like "wait()", the program executes to certain line and wait a moment(like 1 second) then proceed to next line? thanks. | |
I try to resize jpeg from photo size to thumbnails, however the thumbnails quality is bad, it looks fade and blur, I have no idea how to improve the quality of thumbnails. PHP resize function: ----- $first=imagecreatefromjpeg($uploadfile) $second=imagecreate($new_width, $new_height); imagecopyresized($second,$first,0,0,0,0,$new_width,$new_height,$width,$height); imagejpeg($second,$v_thumbnailfile); ----- Thanks for any response. | |
is there a php function that I can verify if the string contains all digital number, not alphabetic charactor? thanks. | |
I have three tables, table1 store records which may have next level ID(child), table2 lists corresponding child ID, and table3 stores the possible message for that particular ID. table1: [CODE]------------------------------------------ ID | group | tochild ------------------------------------------ 1 A y 2 A n 3 B y 4 A y 5 A … |
The End.