Jump to content

Yohanne

Members
  • Posts

    216
  • Joined

  • Last visited

Posts posted by Yohanne

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

  2. @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. 

  3. 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. ?

     

  4. 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++;
    		}
    
  5. Hi all,

     

     

    i have 3 files with .css and 2(.php) 

     

    first i have this->

    1.php

    $public = dirname(__FILE__).'../assits/public/2.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?

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

  8. 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 Acceptable

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

     

     

     

    Thanks

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

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

     

     

     

  11. 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
    
           }
       }
    ?>
    
  12. 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'");
    
           }
    
    
×
×
  • 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.