Jump to content

taps128

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

taps128's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'v configered FCK editor to open the the file browser , and uploader as a php script, but whenewer i access it it uses asp insted. I've tryed everything, I just really don't know what to do now?
  2. Thank you. I tryed using backgroundColor, and it worked. Unfortunately, changing ID s will not be so easily done. Thanks.
  3. Hi. I wanted to change the background color of td field in a table when the user clicks on the field in question. I wrote a script that does that. But, I also want the filed to revert to an another color when the user clicks on it again. That doesn't work. This is the complete code (it uses php to write the tabel) <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title></title> <style type="text/css"> td { cursor:default; } </style> <script type="text/javascript"> function promjeniBoju(id) { var td=document.getElementById(id); if (td.style.background=="red") { td.style.background="yellow"; } else { td.style.background="red"; } } </script> </head> <body> <table border=0> <tr> <? $i=1; while ($i<31) { echo ("<td id=\"$i\" onclick=\"promjeniBoju($i);\">$i</td>"); if ($i%7==0){echo ("</tr><tr>");} $i++; } ?> </tr> </table> </body> </html> Any help will be appreciated. TIA
  4. I solved the problem. Here is the solution [code]SELECT * FROM sirovine WHERE NOT EXISTS ( SELECT * FROM recepti_sirovine WHERE sirovine.sifra_sirovine = recepti_sirovine.sifra_sirovine ) ORDER BY sifra_sirovine ASC [/code]
  5. Hi, Im working on a database for a bakery. I have one table which stores ingediends , and one table which stores recepies and the keys of the ingrediends which go in those recepies. Now I dont want my users to change those ingredients which are allready used by some recepies, the easiest way to do it for me is not to show those ingredients on the change menu I used this sql statement to do it [code]SELECT distinct sirovine.sifra_sirovine as sifra_sirovine , sirovine.naziv_sirovine as naziv_sirovine FROM sirovine,recepti_sirovine WHERE sirovine.sifra_sirovine!=recepti_sirovine.sifra_sirovine ORDER BY sirovine.sifra_sirovine ASC[/code] now, it doesn't work like it should. It still shows ingredients which are used in a recepie. Does any one how can I not show rows whiche have correltaitng data in one other table? TIA
  6. [!--quoteo(post=378080:date=May 29 2006, 02:53 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 29 2006, 02:53 PM) [snapback]378080[/snapback][/div][div class=\'quotemain\'][!--quotec--] The error is saying output is being sent on line 8, which is before the header() is executed at line 86. You can't send ANY output before commands/functions that send HTTP headers like setcookie(), session_start(), header(), and mail(). So, you need to change your logic so no output is sent before these types of functions, or use output buffering. You can put ob_start() at the top of your script (even before session_start). See: [a href=\"http://us2.php.net/manual/en/function.ob-start.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.ob-start.php[/a] FYI: Please note that the header() with location command does not redirect right there and then when it's executed. It actually redirects when your script ends or an exit/die is reached. So, to ensure no logic flow problems in your script, you should have an exit right after every header() with location to force redirection to occur immediately (if that's what you want/expect based on your code logic). [/quote] Well, I used exit() at first and it didn't work. Then I used ob_start and exit toghether and it worked!! Thank you very much for your help.
  7. [code] <? session_start(); if (!$_SESSION['hp']){$_SESSION['hp']=50;} if (!$_SESSION['ap']){$_SESSION['ap']=50;} if (!$_SESSION['cudoviste']){$_SESSION['cudoviste']=20;} if (!$_SESSION['fak']){$_SESSION['fak']=5;} $lokacija="http://majgame.awardspace.com"; echo ("Trgovačka ulica"); echo ("Prazna ulica. Sa svih strana zjape razbijeni izlozi. Sve što je bilo vrijedno u trgovinama već je odavno"); echo ("opljačkano"); echo $_SESSION['stanje'].(""); $_SESSION['stanje']=""; if ($_SESSION['cudoviste']>0)                              {                               echo ("Pred tobom se nalazi muškarac odjeven u staru pohabanu odjeću. Koža mu visi s tijela i jedno mu je oko ispalo.");                              echo ("Napadate ...");                              } //napad cudovista if (rand(1,100)<=60)                     {                     $_SESSION['hp']=$_SESSION['hp']-3;                     echo ("Cudoviste te pogadja za 3 hp-a. Sada imas ").$_SESSION['hp'].(" hp-a.");                     if ($_SESSION['hp']<=0){$mrtav="da";}                     } else {echo ("Cudoviste promasuje.");} echo ("Oprema : sjekira, ").$_SESSION['fak'].(" pribora za prvu pomoc").(""); echo ("AP: ").$_SESSION['ap'].(" HP: ").$_SESSION['hp']; //da li je igrac mrtav. Ukida sve sessione if ($mrtav=="da") {echo ("Mrtav si"); session_destroy();} //status //izbornik za napad ili healenje else { if (!$_POST['posalji'])                        {                        if($_SESSION['cudoviste']>0)                        {                        ?>                        <form  action="<?=$_SERVER['PHP_SELF'];?>" method="POST">                        <input type="hidden" value="napad" name="akcija">                        <input type="submit" name="posalji" value="napad">                        </form>                        <?                        }                        if($_SESSION['fak']>0)                        {                        ?>                        <form  action="<?=$_SERVER['PHP_SELF'];?>" method="POST">                        <input type="hidden" value="ljecenje" name="akcija">                        <input type="submit" name="posalji" value="ljecenje">                        </form>                        <?                        }                        } else     {     $_SESSION['ap']=$_SESSION['ap']-1;     $akcija=$_POST['akcija'];     if ($akcija=="napad")                          {                          if (rand(1,100)<=55)                                              {                                              $_SESSION['cudoviste']=$_SESSION['cudoviste']-5;                                              $_SESSION['stanje']="Udaras cudoviste sa sjekirom za 5 stete, cudoviste ima sada ".$_SESSION['cudoviste'].(" hp-a");                                              if ($_SESSION['cudoviste']<=0){$_SESSION['cudoviste']=-1;}                                              }                          else {$_SESSION['stanje']="Promasio si cudoviste";}                          }     else         {         $_SESSION['hp']=$_SESSION['hp']+5;         $_SESSION['fak']=$_SESSION['fak']-1;         $_SESSION['stanje']="Ljecio si se za 5 hp-a";         if($_SESSION['fak']<=0){$_SESSION['fak']=-1;}         }       $_POST['posalji']=array();              header("Location: http://majgame.awardspace.com/index.php");     } } ?> [/code] This is my game prototoype... and this is the error i get [code] Warning: Cannot modify header information - headers already sent by (output started at /home/www/majgame.awardspace.com/index.php:8) in /home/www/majgame.awardspace.com/index.php on line 86[/code] I looked arounf the net for solution , but nothing seems to work.. no white spaces etc... Anone has any sudggestions?
  8. [!--quoteo(post=374212:date=May 16 2006, 07:34 AM:name=Nikola Stjelja)--][div class=\'quotetop\']QUOTE(Nikola Stjelja @ May 16 2006, 07:34 AM) [snapback]374212[/snapback][/div][div class=\'quotemain\'][!--quotec--] im using a [code] if(!_POST['submit'])                            {                            ..... do form                            } else      {      insert data into the database       } [/code] and as a result on hit submit my browesr starts to search on google, but on another module on the same database it works just fine.. anyone any ideas? [/quote] ... the module works when i use [code]form action="http://localhost/pekare/dosomething.php"[/code] but when i use [code]form action="<?=$_SERVER['PHP_SELF']?>"[/code] i looks for pekare (which is the directory where my db is situated) on serbian yellow pages?! and it seems i corrected the problem the file name was apparently to long .... it was originaly called formular_za_unos_proizvoda.php , and I later shortened it to unos_proizvoda.php
  9. im using a [code] if(!_POST['submit'])                            {                            ..... do form                            } else      {      insert data into the database       } [/code] and as a result on hit submit my browesr starts to search on google, but on another module on the same database it works just fine.. anyone any ideas?
  10. [!--quoteo(post=373958:date=May 15 2006, 09:07 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 15 2006, 09:07 AM) [snapback]373958[/snapback][/div][div class=\'quotemain\'][!--quotec--] The server is most probably cacheing your mysql queries and/or your browser is cacheing your images. So you might want to put [a href=\"http://uk2.php.net/manual/en/function.mysql-free-result.php\" target=\"_blank\"]mysql_free_result[/a] after have got the data from the database and put the following at the top of the PHP scripts that generates your images: [code]header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache");[/code] That code should stop the browser from cacheing your images. [/quote] well, it din't work but thanx for the input its very appriciated.. I'l countinue trying down this road
  11. I'm building a web based database application, and now I'm working on the statistical module. The module takes a series of queries (begging and end date, workshop id), and generates a table countaing the number of each product produced in the given time frame, and a php image showing a graph representation of the table. The image is created via php, and showed on the page via img src="....graph.php". It all works fine, but when I insert a new query the table is generated fine, but the image shows old data. I hit refresh and then the image shows the data from the new query, which is impossible because I use sessions to transmit variables, and the session is destroyed at the end of the module. at first i tpught it was my programming mistake(which it may yet be), then I tought it was my old php version(I upgraded to the current one ) but it was not... any one had a similar problem? My current theory is that its about in the way how the browser/server loads images/scripts.
  12. Hi, all I wanna write a function that returns several results. how man results can a function have?
  13. I fill an array with data collected from a webpage form it looks like this: while ($a<$redovi) {d $pk="proizvedeno_komada".$a; $sp="sifra_proizvoda".$a; $proizvedeno_komada[]=$_POST[$pk]; $sifra_proizvoda[]=$_POST[$sp]; $a++; } And since only integers can be stored inside $proizvedeno_komada, I want to produce a "You can't do that" message if the user entered anything else besides an integer. When I entered only integers the gettype() function echoed string for all of them my checking function goes like this : function kontrola_niza($niz) { $a=array_merge($niz); foreach ($a as $value){ if (is_integer($value)==FALSE) {$r=0;return $r; break;} } $r=1; return $r; } I appriciate all the help you can give me. Nikola
×
×
  • 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.