
PravinS
-
Posts
459 -
Joined
-
Last visited
-
Days Won
2
Posts posted by PravinS
-
-
-
You need to use mod rewrite in .htaccess file.
-
Yes, it can be determined. You can check this url http://www.ip2location.com/
-
Use this function
<?php function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return $value; } ?>
-
Try this
INSERT INTO `tasks` ( `id`, `challenge_id`, `title`, `frequency`, `category`, `description` ) VALUES ( "", 12, "title1", "frequency1", "category1", "somedesc1" ), ( "", 12, "title2", "frequency2", "category2", "somedesc2" ), ( "", 12, "title3", "frequency3", "category3", "somedesc3" );
-
It will be easy it you use MySQL date format function in your query like this
SELECT DATE_FORMAT(DATEFEILD,"%M %e %Y") as dt from TABLENAME
-
What is a data type of date field.
-
Run below given query in MySQL
SELECT UNIX_TIMESTAMP(CURDATE());
-
You can use DATETIME data type.
-
basically you can directly create new config file and write all config content in that file, it will overwrite your old config file.
-
-
You have given "/" after .html in header("Location: ")
-
Use session_unregister(VARIABLE)
-
Write session_start() at the top of every page where you need session variables.
-
Refer this thread, I have post with pagination script
http://www.phpfreaks.com/forums/index.php/topic,289203.msg1370548.html#msg1370548
-
There are few options
1) You can save data bafore sending it to paypal and can have a flag. When payment is done and customer is redirected to site you can check payment status flag from paypal, if it is "Success" then you can update your database flag as done or something.
2) You can have data in session, then after successful payment database can be updated.
-
Use this function, it will return you object in array
function object2array($object) { $return = NULL; if(is_array($object)) { foreach($object as $key => $value) $return[$key] = $this->object2array($value); } else { $var = get_object_vars($object); if($var) { foreach($var as $key => $value) $return[$key] = ($key && !$value) ? NULL : $this->object2array($value); } else return $object; } return $return; }
-
Use this
<?php function select_row($sql) { //echo $sql . "<br />"; if ($sql!="") { $result = mysql_query($sql) or die("Error: ".mysql_errno().":- ".mysql_error()); if ($result) { while($row = mysql_fetch_assoc($result)) $data[] = $row; } return $data; } } function pagingSlot($sql, $recperpage, $pagesetlimit, $page, $class, $getvars) { $rescnt=mysql_query($sql); $totcnt=mysql_num_rows($rescnt); if (!$page) $page = 1; $first=(($page-1)* $recperpage); $sql = $sql . " limit ".$first.",".$recperpage; $res = select_row($sql); $serial_no = ($page - 1) * $recperpage; $t = ($totcnt/$recperpage); $arr=split('[.]',$t); if ($arr[1]) $totalpages=$arr[0]+1; else $totalpages=$arr[0]; if ($totalpages > $pagesetlimit) { if ($page > 1) $pagesetstart = $page - 1; else $pagesetstart = $page; $pagesetend= ($pagesetstart-1) + $pagesetlimit; if ($pagesetend > $totalpages) { $pagesetend = $totalpages; $pagesetstart = $pagesetend - $pagesetlimit + 1; } } else { $pagesetstart = 1; $pagesetend = $totalpages; } $str = ""; if ($page > 1) { $prev = $page - 1; $str.= "<a href='".$_SERVER['PHP_SELF']."?page=$prev".$getvars."' class='".$class."'> << </a> | "; } else { $str.= "<< | "; } for ($i=$pagesetstart; $i<=$pagesetend; $i++) { if ($i <= $totalpages) { if (!$page) $page=1; if ($page==$i) $str.= '<font color=red>'.$i.'</font> '; else $str.= "<a href='".$_SERVER['PHP_SELF']."?page=$i".$getvars."' class='".$class."'>".$i."</a> "; } } if ($page < $totalpages) { $next = $page + 1; $str.= " | <a href='".$_SERVER['PHP_SELF']."?page=$next".$getvars."' class='".$class."'> >> </a> "; } else { $str.= " | >> "; } if ($totcnt == 0) $str = ""; $arr["records"]=$res; $arr["link"]=$str; $arr["serial"]=$serial_no; return $arr; } ?>
-
There may be session_unregister (), session_unset(), session_destroy() functions used in user management page or any file which is included in user management page.
-
Use
$username = substr($geturl[1], 1);
-
Yes it will be better if you fetch correct data from database using query as mentioned by thorpe.
-
Try this
list($client_newsRecords, $client_newsMetaData) = getRecords(array_unique(array( 'tableName' => 'news', 'orderBy' => 'client ASC', )));
-
It will return array.
$username[1] will return you actual username.
-
One way is to use $_SERVER['PHP_SELF'] which will return you "/~username/folder/setup.php", then explode it by "/", will get the result.
"Warning: getimagesize" and "Warning: Division by zero" errors. - please help!
in PHP Coding Help
Posted
getimagesize get size of the image, not of swf file.