1,741 Posted Topics
Re: [url]http://www.javascriptkit.com/script/script2/tengcalendar.shtml[/url] javascript datepicker with directions on how to use it. | |
Re: [inlinecode]header("Location: http://www.online.com/bra_school_bra_fit_calculator_test.php?size=".$bandodd."AA"); [/inlinecode] | |
Re: lol.. hacker9801 is right.. htmlspecialchars will convert html characters like >, <, & to > < and so on.. and mysql_real_escape_string will escape all the special characters in user's input, like, /, ', " etc.. | |
Re: [code=php] <?php $data[0]=88; $data[3]=44; $data[4]=2232; echo " <html> <head> <script type=\"text/javascript\"> function test(){ alert('$data[0]'); } </script> </head> <body onload=\"javascript: test();\"> </body> </html>"; ?> [/code] This is how you can use php variables in your javascript. This is just an example. | |
Re: Alright. You need to check these 2 things. 1. The form has no name. name = "userdetails" is missing. 2. Textarea name is caddr, but you are checking for address. Other than that, I dont see anything wrong. This should work. Cheers, Naveen | |
Re: Alright.. There are few mistakes in your mail script. \n should be put in "". Well, Here is the corrected code. [code=php] <?php //mail.php function checkOK($field) { if (eregi("\r",$field) || eregi("\n",$field)){ die("Invalid Input!"); } } $name=$_POST['name']; checkOK($name); $email=$_POST['email']; checkOK($email); $comments=$_POST['comments']; checkOK($comments); $to="existing.user@gmail.com"; $message=$name."just filled in your comments form. They said: … | |
Re: [quote]Which smoker smells the best? [/quote] TBH, 'no one' (smoker/non-smoker) smells the best, until they brush their teeth (atleast twice a day) and take bath (at least once a day), then empty a can of deo ! | |
Re: Dang ! Do you really need this level of encryption :D ! But anyways, What do you mean by 2 arrays with 2nd code ? | |
Re: [url]http://forums.pcper.com/showthread.php?t=447620[/url] This will probably help you.. | |
Re: [code=php] <?php session_start(); $id=$_GET['fileid']; if($id=="1") { $dwnld = "File1.zip"; } else if($id=="2") { $dwnld = "File2.zip"; } else if($id=="3") { $dwnld= "File3.zip"; } if($id) { header("Content-type: application/octet-stream"); //to specify the content-type of the file. header("Content-Disposition: attachment; filename=".$dwnld."\n\n"); //to 'generate' that file save dialog box echo $dwnld; // writing the contents … | |
Re: Your query is wrong for 2 reasons. 1. The sub query returns more than 1 record. eg. where id = (1,2,3,4) isn't valid. You should use IN clause. 2. The sub query should return only id. You are trying to fetch day and time, which fails query 1. Anyway, your … | |
Re: simple. [code=php] <?php $cart = array(array("Item", 6.99),(array("Item 2", 13.99))); //$cart is a 2 dimensional array print_r($cart); //print the contents of cart unset($cart[0]); //unset 0th array element print_r($cart); //print the cart sort($cart); //sort the cart elements print_r($cart); //print sorted cart ?> [/code] Thats it. :) | |
Re: Do you want unique ips to be put in that text file ? If thats the case, then you fetch the contents of the file uniqueLogs.txt as an array. Then, check if the ip address of the visitor is in that array. If it exists, then don't write the ip … | |
Re: This is mail.html. Here you can add the checkboxes specifying the email address as values to those checkboxes. [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Send mail</title> </head> <body> <form action="mail.php" method="post"> <INPUT TYPE="checkbox" NAME="chk1" value="example1@example.com">Name 1 <br /> <INPUT … | |
Re: Insanity: relatively permanent disorder of the mind. [url]http://wordnet.princeton.edu/perl/webwn?s=insanity[/url] :icon_rolleyes: | |
Re: Try <script type="text/javascript"> I haven't worked on IE7 though. | |
Re: have you set the time for cache expiry ? We have discussed the same thing in this thread. [url]http://www.daniweb.com/forums/thread99489.html[/url] . Try doing the same ! If that doesn't help, well, we have to wait for a php expert to answer. Cheers, Naveen | |
Re: The only possibility is [b]mysql.allow_persistent [/b]is turned off in your php.ini file or it must be commented. Uncomment it and change it value to On. Restart apache/web server and try again. | |
Re: what we do in php is, open the csv file using fopen. Then using the filepointer of fopen, we store the csv values in an array. Then access that array. for example, (in php ie.,) [code=php] <?php $fp = fopen("test.csv", "r"); //open the csv file while ($contents = fgetcsv ($fp, … | |
Re: [code=php] if($chapter!=0){ // if chapter has some value and if its not 0. $prev_link=$chapter - 1; //set previous link as chapter - 1. } else { $prev_link=0; //if chapter = 0, then theres no previous link, make it 0 as well. } if($chapter < count($lines)){ //if the chapter is less … | |
Re: You can just validate it through javascript(Or to check if that field has some value or not.) But, Its much easier if you do it in php. eg. [code=php] if(isset($_POST['sci_name'])){ echo "Scientific name is ". $_POST['sci_name']; } if(isset($_POST['name'])){ echo "General name is ". $_POST['name']; } [/code] | |
Re: You have mentioned you want the rest of the data from 2nd table. But in your query, why do you have a where clause ? where are you passing the id from ? from a php page ? its not a bug. its a syntax error. [url]http://www.webdevelopersnotes.com/tutorials/sql/tutorial_mysql_in_and_between.php3[/url] This is the … | |
Re: give us what you have written so far. | |
Re: Umm! Set the temperature of your AC to -0 (!?!). I am sure, those blood sucking mosquitoes will freeze to death ! Oh well, if you dont have an AC at home, you can hide behind the door and attack them from behind ! | |
Re: [code]$sql="select * from table where (start_date between '$start_date' and '$end_date') or (end_date between '$start_date' and '$end_date')";[/code] considering start_date and end_date are the columns of your table, the first condition will fetch the records if the start_date lies between the range of $start_date and $end_date (the user's input). similarly, it checks … | |
Re: Using ryan_vietnow's pattern, you can get the string between <h4> and </h4>. [code=php] <?php $x="<h4>blah blah blah</h4>"; $reg = '/<h4>(.+)<\/h4>/'; preg_match($reg,$x,$matches); print $matches[0]; ?> [/code] If you wanna learn more bout regular expression, [url=http://www.phpvideotutorials.com/regex/]Here[/url] is the video tutorial. P.S. ryan_vietnow, thanks. I was scratching my head over the same thing … | |
Re: Dont disable it. make it readonly. <input type="text" name="name" value="somevalue" readonly> . | |
Re: [code]if ($show_MYK_PAYPAL == true) { [/code] That should be [code]if ($show_MYK_PAYPAL == "true") { [/code] | |
Re: [QUOTE=ybn1197;483903] Running the following code will list everything properly. But it lists EVERY row from the database. $query = "SELECT * from tblQuotes, tblTitles WHERE tblQuotes.Serial = tblTitles.Serial"; [/QUOTE] The above query is perfect and i dont know WHY it lists every row ! | |
Re: [code=php] <?php header('Cache-Control: no-cache, no-store, must-revalidate'); //HTTP/1.1 header('Expires: Sun, 01 Jul 2005 00:00:00 GMT'); header('Pragma: no-cache'); //HTTP/1.0 ?> [/code] Use the above code to tell the browser not to cache the page. | |
Re: You have mail function in php to send the mail. [url]http://in2.php.net/manual/en/function.mail.php[/url] and its straight forward. | |
Re: $_SERVER['REMOTE_ADDR'] is used to get the IP address of a client. More about it [URL="http://in2.php.net/manual/en/reserved.variables.php#reserved.variables.server"]Here[/URL] | |
Re: why would it update when you are not changing anything ? You should have a form to make the changes. Here, you are just fetching the record from the table, putting it in a textbox, then giving a link with the same value. Try this instead. [code=php] <?php //page1.php $link=mysql_connect($hostname, … | |
Re: Since you want to run exactly the same query and check only for one condition, you can do it this way. [code=php] $query="select * from huge_table where conditions joins etc"; $result=mysql_query($query); $price_p=array(); $price_s=array(); while($row=mysql_fetch_array($result,MYSQL_ASSOC)){ if($row['price']=="P"){ array_push($price_p,$row['price']); } if($row['price']=="S"){ array_push($price_s,$row['price']); } } [/code] So, by the end of the execution of … | |
Re: [QUOTE=steven509;482733]If you don't have access to a server you can install xampp to test on. [url]http://www.apachefriends.org/en/xampp-windows.html[/url] That includes php and is very easy for a beginner to setup and get coding.[/QUOTE] Or even wamp [url]http://www.wampserver.com/en/download.php[/url] | |
Re: why dont you use if else if instead of checking the substring every time ? [code=php] if(substr($row[0],-2,1)=="_") { //$row[0] has only 1 digit after the underscore } else if (substr($row[0],-3,1)=="_"){ //$row[0] has 2 digits after the underscore } else { // $row[0] doesnt have an underscore } [/code] This will … | |
Re: [code=php] <?php //add_days.php if(isset($_REQUEST['submit'])){ $start_date="2007-11-25"; $add_days=$_REQUEST['days']; $new_date = date('Y-m-d', strtotime($start_date.' + '.$add_days. ' days')); echo $new_date; } ?> <html> <body> <FORM METHOD=POST ACTION="add_days.php"> <INPUT TYPE="radio" NAME="days" value="7">7<br /> <INPUT TYPE="radio" NAME="days" value="14">14<br /> <INPUT TYPE="radio" NAME="days" value="30">30<br /> <INPUT TYPE="submit" name="submit" value="submit"> </FORM> </body> </html> [/code] This will do the … | |
Re: Check [url]http://www.goodphptutorials.com/out/Secure_File_Upload_with_PHP[/url] In the above link, you can upload 1 file at a time. You can modify the above code so that it can upload 5 files simultaneously. | |
Re: [code=php] <?php $con=mysql_connect("host","user","pass"); mysql_select_db("dbname"); $query="select columnname from table where condition"; $result=mysql_query($query); $row=mysql_fetch_array($result); $document_contents=$row['columnname']; header("Content-Type: application/msword"); header('Content-Disposition: attachment; filename="document.doc"'); echo $document_contents; ?> [/code] Thats how you retrieve a document from a table. Cheers. Nav | |
Hi all, I am Naveen, an Engineering graduate from India. I have been working on php/mysql for past 1 1/2 yrs. I was searching for something and I accidently got here. I hope to learn something from the forum. Have a nice day! Cheers, Nav | |
Re: You are not passing $id from the previous page. Both has the name "name1". Cheers. |
The End.