1,741 Posted Topics

Member Avatar for kings

[url]http://www.javascriptkit.com/script/script2/tengcalendar.shtml[/url] javascript datepicker with directions on how to use it.

Member Avatar for nav33n
0
45
Member Avatar for miguel40

[inlinecode]header("Location: http://www.online.com/bra_school_bra_fit_calculator_test.php?size=".$bandodd."AA"); [/inlinecode]

Member Avatar for nav33n
0
102
Member Avatar for Taffd

lol.. hacker9801 is right.. htmlspecialchars will convert html characters like >, <, & to &gt; &lt; and so on.. and mysql_real_escape_string will escape all the special characters in user's input, like, /, ', " etc..

Member Avatar for nav33n
0
101
Member Avatar for ruman_eee

[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.

Member Avatar for adorosh
0
112
Member Avatar for kings

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

Member Avatar for hielo
0
103
Member Avatar for vardhani
Re: Form

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: …

Member Avatar for vardhani
0
142
Member Avatar for The Dude

[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 !

Member Avatar for Ezzaral
1
158
Member Avatar for Dsiembab

Dang ! Do you really need this level of encryption :D ! But anyways, What do you mean by 2 arrays with 2nd code ?

Member Avatar for Dsiembab
0
78
Member Avatar for Maxipak

[url]http://forums.pcper.com/showthread.php?t=447620[/url] This will probably help you..

Member Avatar for hughv
0
80
Member Avatar for Pro2000

[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 …

Member Avatar for nav33n
0
191
Member Avatar for lydia21

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 …

Member Avatar for nav33n
0
152
Member Avatar for webguru07

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. :)

Member Avatar for nav33n
0
110
Member Avatar for eXceed69

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 …

Member Avatar for nav33n
0
86
Member Avatar for natep

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 …

Member Avatar for nav33n
0
107
Member Avatar for dvduval

Insanity: relatively permanent disorder of the mind. [url]http://wordnet.princeton.edu/perl/webwn?s=insanity[/url] :icon_rolleyes:

Member Avatar for lasher511
0
134
Member Avatar for manvendra
Member Avatar for paranjyoti

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

Member Avatar for nav33n
0
94
Member Avatar for WebDevGuru

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.

Member Avatar for nav33n
0
70
Member Avatar for vasudha k

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, …

Member Avatar for nav33n
0
65
Member Avatar for DaitoTsu

[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 …

Member Avatar for DaitoTsu
0
192
Member Avatar for ray_broome

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]

Member Avatar for nav33n
0
138
Member Avatar for lydia21

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 …

Member Avatar for nav33n
0
93
Member Avatar for dreamerdevos
Member Avatar for Jicky

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 !

Member Avatar for sneekula
0
411
Member Avatar for kings

[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 …

Member Avatar for nav33n
0
85
Member Avatar for kusal

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 …

Member Avatar for nav33n
0
130
Member Avatar for kings

Dont disable it. make it readonly. <input type="text" name="name" value="somevalue" readonly> .

Member Avatar for kings
0
134
Member Avatar for rtx

[code]if ($show_MYK_PAYPAL == true) { [/code] That should be [code]if ($show_MYK_PAYPAL == "true") { [/code]

Member Avatar for nav33n
0
97
Member Avatar for ybn1197

[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 !

Member Avatar for ybn1197
0
107
Member Avatar for nathanpacker

[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.

Member Avatar for nav33n
0
342
Member Avatar for drsmith

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.

Member Avatar for drsmith
0
113
Member Avatar for rime

$_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]

Member Avatar for nav33n
0
124
Member Avatar for kings

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, …

Member Avatar for nav33n
0
245
Member Avatar for natashenka_66

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 …

Member Avatar for nav33n
0
79
Member Avatar for AYYAD

[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]

Member Avatar for nav33n
0
189
Member Avatar for world_weapon

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 …

Member Avatar for world_weapon
0
178
Member Avatar for jencinas69

[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 …

Member Avatar for jencinas69
0
300
Member Avatar for geekyspaz

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.

Member Avatar for geekyspaz
0
82
Member Avatar for judedcoutho

[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

Member Avatar for nav33n
0
65
Member Avatar for nav33n

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

Member Avatar for zandiago
0
158
Member Avatar for kings

You are not passing $id from the previous page. Both has the name "name1". Cheers.

Member Avatar for nav33n
0
299

The End.