Jump to content

phpchamps

Members
  • Posts

    153
  • Joined

  • Last visited

    Never

Everything posted by phpchamps

  1. if(mysql_num_rows($check_e) =0) there should be == (comparison operator ) not single = (assignment operator)
  2. I m trying to create new module in socialengine but when i run.. i get this error exception 'Engine_Loader_Exception' with message 'Could not load class: Managehomepagebanner_Api_Core' in E:\xampp\htdocs\socialengine\application\libraries\Engine\Loader.php:150 Stack trace: #0 E:\xampp\htdocs\socialengine\application\libraries\Engine\Loader.php(181): Engine_Loader::loadClass('Managehomepageb...') #1 E:\xampp\htdocs\socialengine\application\libraries\Engine\Api.php(296): Engine_Loader->load('Managehomepageb...') #2 E:\xampp\htdocs\socialengine\application\libraries\Engine\Api.php(249): Engine_Api->load('managehomepageb...', 'api', 'core') #3 [internal function]: Engine_Api->__call('managehomepageb...', Array) #4 E:\xampp\htdocs\socialengine\application\modules\ManageHomepageBanner\controllers\AdminManageController.php(29): Engine_Api->managehomepagebanner() #5 E:\xampp\htdocs\socialengine\application\libraries\Zend\Controller\Action.php(513): ManageHomepageBanner_AdminManageController->indexAction() #6 E:\xampp\htdocs\socialengine\application\libraries\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('indexAction') #7 E:\xampp\htdocs\socialengine\application\libraries\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #8 E:\xampp\htdocs\socialengine\application\modules\Core\Bootstrap.php(89): Zend_Controller_Front->dispatch() #9 E:\xampp\htdocs\socialengine\application\libraries\Engine\Application.php(99): Core_Bootstrap->run() #10 E:\xampp\htdocs\socialengine\application\index.php(183): Engine_Application->run() #11 E:\xampp\htdocs\socialengine\index.php(15): include('E:\xampp\htdocs...') #12 {main} Any help is appreciated
  3. Below is the code for the PNG... <?php header("Content-type: image/png"); // CONTENT TYPE OF OUTPUT FILE $string = 'phpchamps'; // STRING TO BE PRINTED ON THE IMAGE $im = imagecreatefrompng("button1.png"); // BACKGROUND IMAGE ON WHICH TEXT TO BE PRINTEND $orange = imagecolorallocate($im, 0, 0, 60); // COLOR OF THE TEXT $px = (imagesx($im) - 9 * strlen($string)) / 2; // MARGIN TO BE SET imagestring($im, 9, $px, 29, $string, $orange); imagepng($im); imagedestroy($im); ?>
  4. I dont think there is anything on the js side. In which format you are returning the data from the w.php file... can you share the database schema and w.php file also..
  5. please post the full code.
  6. If the return_var argument is present along with the output argument, then the return status of the executed command will be written to this variable. I would suggest you to use ftp commands of php to copy files to different server. http://php.net/manual/en/book.ftp.php
  7. Below function will check whether its a ajax request or nt.. function isAjax() {return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'));}
  8. Hey Natasha, As you are using the exec command the third parameter of exec command is return_var which will return the status of the execture command. I think you should check for the return status and if status is true then you can continue the loop or else break it. Hope it helps. Thanks.
  9. did you check the permission ???
  10. Hops this helps : <?php $db = mysql_connect('localhost','root','') or die("Database error"); mysql_select_db('test', $db); $result = mysql_query("set names 'utf8'"); $query = "select * from test"; $result = mysql_query($query); $returnArr = array(); while($row = mysql_fetch_array($result)){ $returnArr[$row['id_1']] = $row['id_2']; } $searchArr = 100; // Enter the key to be searched if(array_key_exists($searchArr,$returnArr)){ // This will check the whether key exists or not echo "Available Value Is :". $returnArr[$searchArr]; }else{ echo "Key Doesnt Exists"; } ?>
  11. Crontab has a specific format. below is the format... Min Hour Day/month Month Day/week Description 30 0 1 1,6,12 * 00:30 Hrs on 1st of Jan, June & Dec. 0 20 * 10 1-5 8.00 PM every weekday (Mon-Fri) only in Oct. I think what you require is:- Min Hour Day/month Month Day/week Description /20 00-06 * * 1-7 [td][/td] Hope this helps....
  12. hope this helps you http://lists.mysql.com/mysql/182361
  13. i dont know why ur didnt work.. just modified ur script as i dont have DB and it worked for me.. find attached screenshot <?phpclass CSVExport{public function __construct(){}public function exportCSV(){ $result = array(array('name' => 'atul', 'age' => '26'), array('name' => 'viral', 'age' => '34'), array('name' => 'mahesh', 'age' => '44')); $fname = 'CSVFile.csv'; $headers = array(); $rowArray = array(); $numFields = 2; for ($i = 0; $i < $numFields; $i++) { $headers[$i]['name'] = $result[$i]['name']; $headers[$i]['age'] = $result[$i]['age']; } $fp = fopen($fname, 'w'); if ($fp && $result) { header('Content-Type: application/csv'); header('Content-Disposition: inline; filename='.$fname); fputcsv($fp, $headers); while ($thisrow = mysql_fetch_row($result)) { fputcsv($fp, $thisrow); } readfile($fname); fclose($fp); }die;}}$obj = new CSVExport();$obj->exportCSV();?> [attachment deleted by admin]
  14. The best book for this is PHP|arch - Guide to php security... http://www.phparch.com/books/phparchitects-guide-to-php-security/
  15. why 777??? write permission to others also ????? give 775 or 755 .....
  16. your question is not at all clear.. and solution suggested by Mr. Chintan not gonna help you.. Please post your clear requirement....
  17. You will have to force download that : Below is the example code // Define the path to file$file = 'ryboe_tag_cloud.zip';if(!file){ // File doesn't exist, output error die('file not found');}else{ // Set headers header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=$file"); header("Content-Type: application/zip"); header("Content-Transfer-Encoding: binary"); // Read the file from disk readfile($file);}
  18. i am not sure whether this can help or not: but your problem seems to be similar (command working from batch file or command line and not through shell_exec). I found out that in my case some things needed to be set (which normally are set by default). the options -jo -j means: don't recreate the paths found in the archive -o means: always overwrite files And I needed to specify the destination path (even though it should unzip in the same directory when not specified), this is done by -d [path] The strange thing was that I didn't have to put these options when I would give the command on the command-line, only when I would call it with shell_exec. So the complete command in php would be for me: shell_exec('unzip -jo /path_to_archive/archive.zip -d /destination_path') And putting en echo in front will help you a lot. it should tell you something like this: Archive: /path_to_zip/archive.zip inflating: /destination_path/file1.jpeg inflating: /destination_path/file2.jpeg inflating: /destination_path/file3.jpeg
  19. set up a cronjob for that which will run daily..... find all the question which were posted 4 days ago.. change the status or delete the questions.
  20. working perfectly for me... <?php class Session { var $username; //Username given on sign-up var $userid; //Random value generated on current login function Session(){ $this->time = time(); $this->startSession(); $this->userid = $_SESSION['userid'] = $this->generateRandID(); } function startSession(){ echo "AAA"; } function generateRandStr(){ echo rand(0,49); } function generateRandID(){ return md5($this->generateRandStr(16)); } } $obj = new Session(); ?>
  21. according to be best way would be create a XSD file which will validate the response based on that show it.
  22. please post fulll code.
  23. You will get these notices if google is not returning the whether information. because in your code you have not checked if that element is exists then only show it or only if the return xml from google is right then only execute code... you can try "Delhi" (without quotes) in your post data and you will not get notice because this time google will return successful xml.
  24. whts the problem?? r u getting any error message?
  25. can you post the full code???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.