Jump to content

Yohanne

Members
  • Posts

    216
  • Joined

  • Last visited

Everything posted by Yohanne

  1. Thanks for your reply, and in this case i use __autoload function. i think it is same function into include.
  2. i need to login but first here is my code. Class_login.php class Class_login { public function get_post() { $Message = array(); if(empty($_POST['VAR1'])) { $Message = 'Please fill-in required field'; } else { $_POST['VAR1'] = mysql_real_escape_string($_POST['VAR1']); } if(sizeof($Message) > 0) { $array_lenght = count($Message); for($i = 0; $i < $array_lenght; $i++) { echo $Message[$i]; echo "</br>"; } } else { header('Location:saa.php'); } return false } } login.php <?php function __autoload($classname) { $filename = "./../Class/". $classname .".php"; include_once($filename); } $newClass = new Class_login(); public function actionLogin() { if(isset($_POST['submit']) && 'Login' == $_POST['submit']) { ????#########? } else { false; } } ?> now, how do i call the function "get_post" from Class_login, and i want it to use inside the login.php. Thanks
  3. @Strider64 it is what im looking. and more question. ./myClass.php <?php class myClass { public function __construct() { echo "myClass init'ed successfuly!!!"; } } ?> ./index.php <?php // we've writen this code where we need function __autoload($classname) { $filename = "./". $classname .".php"; include_once($filename); } // we've called a class *** $obj = new myClass(); ?> i dont really get the function of this variable "$filename" and "$classname". i found out that there is no value. could you explain the two variable.
  4. Hi Coders, I have four or more files that load into one file, like below. one.php <?php class one { public function One() { ..... } } ?> one_one.php <?php class one { public function One_one() { ..... } } ?> two.php require_once 'one.php'; require_once 'one_one.php'; and any good idea how to call a class parameter from a one.php and one_one.php files which is only two.php file that i call here three.php <?php require_once 'two.php'; class all { public function __construc() { $x = new One(); } } any good example. ?
  5. hello coders. what is the possible reason why i get this warning: Invalid argument supplied for foreach() in and i have no idea behind this code, but i know there is someone else can read this and understand behind the logic. $orders = Order::getOrdersWithInformations(10); $i = 0; foreach($orders AS $order) { $currency = Currency::getCurrency((int)$order['id_currency']); echo ' <tr'.($i % 2 ? ' id="order_line1"' : '').'> <td class="order_td_first order_id">'.(int)$order['id_order'].'</td> <td class="order_customer">'.Tools::htmlentitiesUTF8($order['firstname']).' '.Tools::htmlentitiesUTF8($order['lastname']).'</td> <td class="order_status">'.Tools::htmlentitiesUTF8($order['state_name']).'</td> <td class="order_total">'.Tools::displayPrice((float)$order['total_paid'], $currency).'</td> <td class="order_action"> <a href="index.php?tab=AdminOrders&id_order='.(int)$order['id_order'].'&vieworder&token='.Tools::getAdminTokenLite('AdminOrders').'" title="'.$this->l('Details').'"><img src="../img/admin/details.gif" alt="'.$this->l('See').'" /></a> </td> </tr> '; $i++; }
  6. Hi all, i have 3 files with .css and 2(.php) first i have this-> 1.php $public = dirname(__FILE__).'../assits/public/home.php'; require_once($public); 2.php <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Under The Bridge</title> <link href="style.css" rel="stylesheet" type="text/css" media="all" /> </head> <body> sample </body> </html> style.css body { background-color:#000000; } now when i trying to view the result, the background from css could not effect, while the the txt "sample" is there. why? and where i am doing wrong?
  7. hai all, any body here knows how to add new page using yii FW? Thank You.
  8. Hai all, how do i fined if the file paramter is look like this: how to read this code to fined this "MY WEB APPLICATION" the behind of the code below. <?php echo CHtml::encode(Yii::app()->name); ?>
  9. same here i got a problem and show message as follow: Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.' in C:\xampp\htdocs\zendyou\init_autoloader.php:48 Stack trace: #0 C:\xampp\htdocs\zendyou\public\index.php(9): require() #1 {main} thrown in C:\xampp\htdocs\zendyou\init_autoloader.php on line 48 and a don't know to solve this. could you please help what to.
  10. okay thanks for you great chart and so what can i do to solve this issue? is there is any issue about the code that i need to debug?
  11. You mean it is all about hosting provider?
  12. Hai All. i got this message from the site where i am the admin. and i don't have any idea if what is this message means? any body here experience like this notification/message and can you help and assist what wrong with this? Not AcceptableAdditionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Thanks
  13. but somehow i try as you said above. like this C:\wamp\bin\php\php5.3.8\php.exe composer.phar install and i get this: Could not open input file:composer.install
  14. okay. but i already installed the composer through thre app. and i installed the composer through this path c:/wamp/bin/php/php5.3.8/php.exe, and i don't know if it is correct, please help
  15. i used latest version of zendFwork and skeleton app from gethub
  16. Hi all. this is my first time in ZF and i have no any idea if how to fix it .. could you please assist and help me how to fix this problem. im using local server the wamp. and i got the following. - Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.' in C:\wamp\www\zendy\init_autoloader.php on line 48 RuntimeException: Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable. in C:\wamp\www\zendy\init_autoloader.php on line 48
  17. try to use if statement and php operator
  18. try this $num_items = mysql_result(mysql_query("SELECT COUNT * as items FROM shopping_cart WHERE cart_identifier = . mysql_escape_string($cart_id) .''"),0);
  19. http://www.php.net/manual/en/datetime.format.php
  20. Okay, i will try it in home. thanks for this informative triks. and i think it is work great.
  21. Hi all, how to call a function where a function is decleared into different or other page? page1.php <?php class class_a { public function x(); { code methods here. } } ?> page2.php <?php require_once 'page1.php'; class class_b { public function __cinstruct() { $new_class_a = new class_a(); } public function y(); { : how to call x function? here } } ?>
  22. this is my way public function cleared($data) { $data = trim(htmlentities(strip_tags($data))); if(get_magic_quotes_gpc()) { $data = stripslashes($data); $data = mysql_real_escape_string($data); } return $data; } public function set_post() { foreach($_POST as $key => $values) { $my_POST[$key] = $this->cleared($values); } } $pass = $this->set_post(substr(sha1($this->set_post->$my_POST['pass']),18,7); public function login_() { $cheked_user->set_result("SELECT pass FROM tbl_user_ WHERE pass = '$pass'"); }
  23. $query = mysql_query("SELECT * FROM users WHERE user_id != 'your_session_id'") mysql_query can do that..
×
×
  • 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.