
ansarka
Members-
Posts
128 -
Joined
-
Last visited
Never
Everything posted by ansarka
-
http://in.php.net/date Month --- --- F A full textual representation of a month, such as January or March January through December m Numeric representation of a month, with leading zeros 01 through 12 M A short textual representation of a month, three letters Jan through Dec n Numeric representation of a month, without leading zeros 1 through 12 t Number of days in the given month 28 through 31 Year --- --- L Whether it's a leap year 1 if it is a leap year, 0 otherwise. o ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0) Examples: 1999 or 2003 Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003 y A two digit representation of a year Examples: 99 or 03
-
its a good method i am sorry for giving wrong information
-
ONLY ANSWER IS AJAX
-
chk this link http://www.webcheatsheet.com/php/create_thumbnail_images.php
-
hi Its not good to store the values into db with out completing the form entry you can solve this problem in two ways one normal way submit the form to second page and store all the fields in hidden value or duplicate the same form and set the text box values to submit values Or second method was to use AJAX to fill the comobo box according to the chnage in first combobox , this method will be most use fulland simple for the user too
-
Quicky about using unset() in 'return' value
ansarka replied to timmy0320's topic in PHP Coding Help
change your function to function _unset($name) { unset($_SESSION[''.$name.'']); return 1; } // you cant assign an unset function result to a variable -
Try this http://www.daniweb.com/forums/thread60795.html <?php $fileatt = "mypdffile.pdf"; // Path to the file $fileatt_type = "application/pdf"; // File Type $fileatt_name = "mypdffile.pdf"; // Filename that will be used for the file as the attachment $email_from = "[email protected]"; // Who the email is from $email_subject = "Your attached file"; // The Subject of the email $email_message = "Thanks for visiting mysite.com! Here is your free file.<br>"; $email_message .= "Thanks for visiting.<br>"; // Message that the email has in it $email_to = $_POST['email']; // Who the email is to $headers = "From: ".$email_from; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data .= "\n\n" . "--{$mime_boundary}--\n"; $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo "<font face=verdana size=2><center>You file has been sent<br> to the email address you specified.<br> Make sure to check your junk mail!<br> Click <a href=\"#\" onclick=\"history.back();\">here</a> to return to mysite.com.</center>"; } else { die("Sorry but the email could not be sent. Please go back and try again!"); } ?>
-
try this $newtext = wordwrap($text, 15, "\n", true);
-
(SELECT * FROM `table` where status=1 order by date desc limit 1) union ( SELECT * FROM `table` where status=0 order by date desc limit 1) you will get two rows with latest status change from 1 to 0 or 0 to 1
-
HI friends I would like to know how to connect SVN with php i want to check in and check out files from remote svn using web application plz reply Regards Ansar K A
-
Hello friends I want to code a email server in which users can create there own email ids check email and send email . Actually my client want to provide email id to every user registered with our site Can any one plz help me :(
-
In my current server i am using php 4.1 and mysql 3 . The server is running many web site whichis very popular and has huge hit ever day Now i would like to upgrade my version of php and mysql to php 5 and mysql 5 Will it affect the working of current sites Wheather the upgradation of version wil effect in loss of data or will it affect any php codes
-
[!--quoteo(post=371447:date=May 4 2006, 10:40 PM:name=glennn.php)--][div class=\'quotetop\']QUOTE(glennn.php @ May 4 2006, 10:40 PM) [snapback]371447[/snapback][/div][div class=\'quotemain\'][!--quotec--] i have this login script but the author provided no logout feature - i'd like to be able to kill the session without the user having to close his browser: [code] if (!$errortag){ session_register("CID"); $_SESSION["CID"] = $customerid; $CID = $customerid; $showtable = false; } [/code] can anyone help? have i provided enough info? I know this is simple - the reason i love these forums is that ya'll can't see me turn red in embarrassment at such times... thanks, g [/quote] if you want to kill all session varibles you can use session_destroy(); If you want to kill only one variable you can use session_unregister("CID");
-
if(isset($need['friend'])) { $mailBody .= "- social reasons\n"; $mailBody .= "Importance:[i] $importance[0] [/i]\n\n"; } if(isset($need['sell'])) { $mailBody .= "- sale and negotiations\n"; $mailBody .= "Importance:[i] $importance[1] [/i]\n\n"; }
-
[!--quoteo(post=371208:date=May 4 2006, 06:45 AM:name=Poland)--][div class=\'quotetop\']QUOTE(Poland @ May 4 2006, 06:45 AM) [snapback]371208[/snapback][/div][div class=\'quotemain\'][!--quotec--] so what has changed in the code? I don't see any changes. [/quote] Check the code complty before making any comments i hve added some extra code to your code plz check each and every lin in the php tag
-
[!--quoteo(post=371200:date=May 4 2006, 06:13 AM:name=pixeltrace)--][div class=\'quotetop\']QUOTE(pixeltrace @ May 4 2006, 06:13 AM) [snapback]371200[/snapback][/div][div class=\'quotemain\'][!--quotec--] guys, i need help on this. i have posted this problem before and i thought i already came up with a solution but its still not working. what i wanted to happen in my script is that: i have a data with corresponding dates. so on my website, what i wanted to happen is if the date of my data is >= to the systemdate my site will load upcoming.php but when the date of my data is < the systemdate my site will load noupcoming.php. below is my current script and what it does is, it only loads the noupcoming.php whether my data is >= or < the system date. i short its not functioning to what i wanted it to be. ========== <? include 'db_connect.php'; $uSql = "SELECT event_date FROM events"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } else{ while($uRow = mysql_fetch_row($uResult)){ $eventdate = $uRow['event_date']; $systemdate = date('y-m-d'); } } if ($eventdate >= $systemdate) {$urls = 'upcomingmain.php';} else { $urls = 'noupcoming.php'; } ?> =============== hope you could help me with this. thanks a lot! [/quote] [code] <? include 'db_connect.php'; $uSql = "SELECT event_date FROM events"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } else{ while($uRow = mysql_fetch_row($uResult)) { $eventdate=date("y-m-d", strtotime($uRow[event_date])); $systemdate = date('y-m-d'); } } if ($eventdate >= $systemdate) {$urls = 'upcomingmain.php';} else { $urls = 'noupcoming.php'; } ?>[/code] Plz try this code
-
[code]<? $need = array(); $importance = array(); $importance[0] = $_POST["importance"]; $importance[1] = $_POST["importance1"]; $mailBody = "I need english to:\n\n"; if(isset($need['friend'])) { $mailBody .= "- social reasons\n"; $mailBody .= "Importance: ".$importance[0]."\n\n"; } if(isset($need['sell'])) { $mailBody .= "- sale and negotiations\n"; $mailBody .= "Importance: ".$importance[1]."\n\n"; } $mail_to = "[email protected]"; //To mail which is retrieved form the data base $mail_from = "[email protected]"; //From mail $mail_subject = "Details12";//subject header /* To send HTML mail, you can set the Content-type header. */ $headers = "MIME-Version: 1.0\n"; //setting the mime version. To send the html we have to set MIME ver 1.0 ######################################################################## # IMP IF THIS CODE DOESNT WORK ADD \r\n INSTEAD OF \n IN HEADERS ####################################################################### $headers .= "Content-type: text/html; charset=iso-8859-1\n"; //for send ing the html file /* additional headers */ $headers .= "From: Ansar<[email protected]>\n"; //headers from address //$headers .= "Cc: [email protected]\n"; //$headers .= "Bcc: [email protected]\n"; //$body=htmlentities($body); //Function to send mail mail($mail_to,$mail_subject,$mailBody,$headers); ?> <form action="<?=PHP_SELF?>" method="post" name="order"> <p> <INPUT TYPE="checkbox" NAME="need[friend]" value="friend" onclick="javascript:document.order.importance.disabled=false" <? echo isset($need['friend']) ? 'checked' : ''; ?> > social reasons<br> <select disabled="true" name="importance"> <option value="0" <? echo ($importance[0] == '0' ? 'selected' : '') ?>>-</option> <option value="1" <? echo ($importance[0] == '1' ? 'selected' : '') ?>>1</option> <option value="2" <? echo ($importance[0] == '2' ? 'selected' : '') ?>>2</option> <option value="3" <? echo ($importance[0] == '3' ? 'selected' : '') ?>>3</option> <option value="4" <? echo ($importance[0] == '4' ? 'selected' : '') ?>>4</option> <option value="5" <? echo ($importance[0] == '5' ? 'selected' : '') ?>>5</option> </select> </p> <p> <INPUT TYPE="checkbox" NAME="need[sell]" value="sell" onclick="javascript:document.order.importance1.disabled=false"<? echo isset($need['sell']) ? 'checked' : ''; ?>> sales and negotiations<br> <select name="importance1" disabled="true"> <option value="0" <? echo ($importance[1] == '0' ? 'selected' : '') ?>>-</option> <option value="1" <? echo ($importance[1] == '1' ? 'selected' : '') ?>>1</option> <option value="2" <? echo ($importance[1] == '2' ? 'selected' : '') ?>>2</option> <option value="3" <? echo ($importance[1] == '3' ? 'selected' : '') ?>>3</option> <option value="4" <? echo ($importance[1] == '4' ? 'selected' : '') ?>>4</option> <option value="5" <? echo ($importance[1] == '5' ? 'selected' : '') ?>>5</option> </select> <input type="submit" name="Submit" value="Submit"> </p> </form>[/code] TRY THIS CODE
-
let me confirm your requirement You have a form i which ther is two combo boxes and when i click submit the the selected combobx values should be send to the email . I want to ask you wheather you want to select a single value from a combo box or multiple values
-
[!--quoteo(post=371006:date=May 3 2006, 01:51 PM:name=SharkBait)--][div class=\'quotetop\']QUOTE(SharkBait @ May 3 2006, 01:51 PM) [snapback]371006[/snapback][/div][div class=\'quotemain\'][!--quotec--] I understand the the GC does its thing. But I am trying to figure out what setting I have that makes the sessions timeout. There are no cron jobs that are clearing them. I've compared the php.ini file on my server and the one I on my development server Both are the same. but the development server, the sessions do not timeout. My scripts don't manual change the GC timeout either. *shrug* [/quote] Are you sure teh session.gc_maxlifetime in your server and devlopment server is same i think you are worng session.gc_maxlifetime = 1440 If so can send the code you are using
-
[b] Plz try this by removing the single quote in the get where story_id=".$_GET[story_id]); and you hv put an extra "}" in line number 31 plz check taht also and try to connect mysql before sending any sql queries [/b]
-
Plz click te link below you will find the code you are looking for [a href=\"http://smallcapitalbusiness.com/freescript.php\" target=\"_blank\"]http://smallcapitalbusiness.com/freescript.php[/a]
-
[!--quoteo(post=371126:date=May 3 2006, 09:12 PM:name=saranda)--][div class=\'quotetop\']QUOTE(saranda @ May 3 2006, 09:12 PM) [snapback]371126[/snapback][/div][div class=\'quotemain\'][!--quotec--] is there any posebility to put dropdown menu work in onchange eavent in php something like this <body> <? function une() { echo $zip; } ?> <select size="1" name="zip" id="zip" onchange="une()" /> <option value="value1"> Place of departure </option> <option value="KKK">kkk</option> <option value="KKK">bbb</option> </select> <input type="text" value="" id="K" name ="K"> </body> </html> or if you can achive this thing but in any other method please tell me thnx.... [/quote] You can use javascript to do this or you can you the new technology AJAX for the pourpose [!--quoteo(post=371188:date=May 4 2006, 04:41 AM:name=anuka)--][div class=\'quotetop\']QUOTE(anuka @ May 4 2006, 04:41 AM) [snapback]371188[/snapback][/div][div class=\'quotemain\'][!--quotec--] You can use javascript to do this or you can you the new technology AJAX for the pourpose [/quote] Here is a sample code index.php [code]<? // Edit these values {{{ $sql_host = 'localhost'; $sql_user = 'root'; $sql_pass = ''; $sql_db = 'test'; // }}} End edit ?> <script language="JavaScript"> var arItems = new Array() arItems = [ <? mysql_connect($sql_host, $sql_user, $sql_pass); mysql_select_db($sql_db); $qry = mysql_query('SELECT * FROM temp WHERE parent > 0'); while ($row = mysql_fetch_array($qry)) { $arr.= '[' . $row['parent'] . ', ' . $row['id'] . ', \'' . $row['name'] . '\'],' . "\n\t"; } $final = substr($arr, 0, -3); echo $final; ?> ] function fillItems( intStart ) { var fTypes = document.form1.types var fItems = document.form1.items var a = arItems var b, c, d, intItem, intType if ( intStart > 0 ) { for ( b = 0; b < a.length; b++ ) { if ( a[b][1] == intStart ) { intType = a[b][0]; } } for ( c = 0; c < fTypes.length; c++ ) { if ( fTypes.options[ c ].value == intType ) { fTypes.selectedIndex = c; } } } if ( intType == null ) { intType = fTypes.options[ fTypes.selectedIndex ].value } fItems.options.length = 0; for ( d = 0; d < a.length; d++ ) { if ( a[d][0] == intType ) { fItems.options[ fItems.options.length ] = new Option( a[d][2], a[d][1] ); // no line-break here } if ( a[d][1] == intStart ) { fItems.selectedIndex = fItems.options.length - 1; } } } </script> <form name="form1"> <select name="types" onChange="fillItems(0)"> <option value="#" selected="selected">Please select</option> <? mysql_connect($sql_host, $sql_user, $sql_pass); mysql_select_db($sql_db); $qry = mysql_query('SELECT * FROM temp WHERE parent = 0'); while ($row = mysql_fetch_array($qry)) { ?> <option value="<?=$row['id'];?>"><?=$row['name'];?></option> <? } ?> </select> <select name="items"></select> </form> [/code] sql file CREATE TABLE `temp` ( `id` int(11) NOT NULL auto_increment, `parent` int(11) NOT NULL default '0', `name` varchar(45) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Gegevens worden uitgevoerd voor tabel `temp` -- INSERT INTO `temp` VALUES (1, 0, 'BMW'); INSERT INTO `temp` VALUES (2, 0, 'Mercedes'); INSERT INTO `temp` VALUES (3, 1, '3 Series'); INSERT INTO `temp` VALUES (4, 1, '5 Series'); INSERT INTO `temp` VALUES (5, 2, 'SLK'); INSERT INTO `temp` VALUES (6, 2, 'Maybach'); Hope this will help you
-
[!--quoteo(post=370560:date=May 2 2006, 09:42 AM:name=Richie455)--][div class=\'quotetop\']QUOTE(Richie455 @ May 2 2006, 09:42 AM) [snapback]370560[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks so much - fantastic - it works! [/quote] in php config file if you turned of global varibles you will have to use $_session['vaiablename']; to get the session registerd variable values If the globalvaraible in turned on in php config file you can directly use the session variable
-
Umasankar Subramanian thank you for your reply what i am looking for is if i enterd [email protected] wheather [email protected] is a existing email id