Jump to content

Gurzi

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Gurzi's Achievements

Member

Member (2/5)

0

Reputation

  1. session_start() will register internal output handler for URL rewriting when trans-sid is enabled. If a user uses ob_gzhandler or like with ob_start(), the order of output handler is important for proper output. For example, user must register ob_gzhandler before session start. Ok, i'm not sure if it said headers or just output already sent, but in the session_start function description, it says that i throws output
  2. does the session_start deliver some output ?
  3. i don't have the error anymore, and i can't put online the old way, but it is just how i said, headers already sent
  4. I was trying to develop an captcha system so i had this <?php session_start(); if($_POST['captcha'] != $_SESSION['captcha']){ header("Location: index.php"); }else{ // do something } ?> When the user entered the captcha wrong, it says that output already had been sent. So i tried this way: <?php session_start(); $test = $_SESSION['captcha']; session_destroy(); if($test != $_POST['captcha']){ header("Location: index.php"); }else{ // do something } ?> and it worked :S but i dont know the reason :x
  5. Hello, i have a weird doubt and i dont know the answer. I was using the session_start in the first line of my code, and 5 lines after i had to use the header() function and of course it said that ouput already had been sent. I understood and i tried something, like this session_start() session_destroy() header() and it worked, and i dont know why , doesn't it sent ouput to the browser ?? Weird :s
  6. Hello guys, at this moment i have 2 distinct classes, User and Product. Now i need a bunch of methods to list products( for example, products recently added, all the products, etc) . Where shall i define this methods ? Inside the class User ? Product ? within a new Class? Can you give me some advices ? Thanks
  7. FOUND! Sorry but i'm working on a team and i am using ajax, and the another guy forgot to retire the name of the file from the <form action=""> so it was calling the file twice I didn't see it Sorry And thanks a lot
  8. I said the same, it's impossible, but it's happening !! I changed $database->execute to mysql_query() and it's the same, it inserts the query twice and i tried using echo constant string has you said and it just returned one time. The stupid thing now it's that i have this foreach($_POST['produtos'] AS $key=>$value){ $adicionaProdutoQuery = "INSERT INTO Proposta_Produto_Temporario(IDPropostaTemporaria,IDProduto) VALUES($idProposta,$value)"; //echo $adicionaProdutoQuery . "<br />"; //$database->execute($adicionaProdutoQuery); mysql_query($adicionaProdutoQuery); echo "a"; } and it's executing the query 2 times but i just see a single "a" character.
  9. I did var_dump at the $_POST and it has returned : array(2) { ["idProduto"]=> string(1) "2" ["produtos"]=> array(1) { [0]=> string(1) "1" } } after i did this foreach($_POST['produtos'] AS $key=>$value){ $adicionaProdutoQuery = "INSERT INTO Proposta_Produto_Temporario(IDPropostaTemporaria,IDProduto) VALUES($idProposta,$value)"; //echo $adicionaProdutoQuery . "<br />"; $database->execute($adicionaProdutoQuery); } The funniest thing here, is that if i use the echo, it just prints one time, but if i use the $database->execute() , it inserts the query twice. I really don't understand :x Any ideas ?
  10. It said that i cannot have values defined in interface arguments list.
  11. <?php include("class.factorydatabase.php"); Class ligadb{ private static $lconnection = false; private static $type = "MYSQLPROD"; private function __construct(){} public static function getInstance(){ if( self::$connection === false){ self::$connection = FactoryDatabase::getDatabaseConnection(self::$type); } return self::$connection; } } ?> This is my Singleton class that works with Factory pattern ( FactoryDatabase file ) and now i'm developing one class for set/get categories(products) and i need to make some inserts/selects in the database. Wich is the most professional method to work with the database in the class ? Shall i include the ligadb.php in every file and create an instance of that class? Something like this <?php include_once("class.ligadb.php"); Class Category { private $connection; public function __construct(){ $connection = ligadb::getInstance(); } public function setCategory(){ $this->connection->execute(" INSERT BLABLABLABLA"); } }?> Is this the right way to accomplish the goal ? Help
  12. Hello Guys, i defined an interface for my databases and now i have this method in my interface: public function queryUniqueObject($query, $debug ); My problem is that i alwasy done without interfaces this methodas as public function queryUniqueObject($query, $debug = false ); If now i try to use this last method in the class that implements the interface, it says that it has to be like that ( interface ). But in the interface, it doesn't let me put the method like $debug= false. Why ? how can i solve this ? because i really dont want to modify my entire code.
  13. Hello everyone I am trying to use CodeIgniter and i am a little bit confused. I have the file index.php that has the entire website layout. I will need to use it in a lot of differente pages. The only thing that really change is the div content that is inside the index.php. How i can create just one file and use it in different pages ? Create the header and footer in differente pages and use include ? ( this is the default style that i use ) but with MVC Pattern i dont know if this is the right method to reach the goal. any suggestions ? thanks
  14. Hello everyone I am trying to use CodeIgniter and i am a little bit confused. I have the file index.php that has the entire website layout. I will need to use it in a lot of differente pages. The only thing that really change is the div content that is inside the index.php. How i can create just one file and use it in different pages ? Create the header and footer in differente pages and use include ? ( this is the default style that i use ) but with MVC Pattern i dont know if this is the right method to reach the goal. any suggestions ? thanks
  15. Does it possible to modify Eclipse PHP to recognise NaturalDoc ?
×
×
  • 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.