Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
odjednom mi ne rade formovi
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.01.2006 19:43    Post subject: odjednom mi ne rade formovi Add user to your forum ignore list Reply with quote

ne kuzim. sve je radilo savrseno. i onda sam se zacudila kako to vec par tjedana nikakav komentar ili mail, pa sam odlucila isprobati sama i ne dogadja se nista! Shocked

u medjuvremenu je bio pao server (i PHP nije radio par dana), sto se moglo poremetiti da sad formulari ne rade?

ima li veze sto je application/xhtml+xml? mada, ne radi ni u IE-u pa mislim da nije to.

P.S. mozete isprobati: http://inobscuro.com/guestbook/

EDIT
postojeci problem je rijesen, ali pojavio se novi.

Last edited by nel`chee on 01.02.2006 01:16; edited 2 times in total

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 31.01.2006 20:23    Post subject: Add user to your forum ignore list Reply with quote

globalne varijable? koji ti je tip polja za primary key u bazi podataka? i koji ti je zadnji id?

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.01.2006 20:46    Post subject: Add user to your forum ignore list Reply with quote

koristim $name = $_POST['name'] itd. kad ih prihvacam...

mwahahhah, baza podataka mi je txt file Wink problem je da cak i kad ostavim prazan form ne dogodi se nista, a trebalo bi napisati gresku.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 31.01.2006 20:48    Post subject: Add user to your forum ignore list Reply with quote

daj koda :)

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 31.01.2006 20:52    Post subject: Add user to your forum ignore list Reply with quote

da ti mozda neki redirect ili mod_rewrite ne zajebava.

prasni "die('evo me');" u dio koda gdje radis to preuzimanje varijabli i upisivanje u fajl, da vidis da li skripta uopce skripta do toga dodje.

_________________
Bolje biti malo lud, nego malo pametan.
Back to top
View user's profile Send private message Visit poster's website
lekke



Joined: 17 Jun 2004
Posts: 860
Location: 25th floor

PostPosted: 31.01.2006 20:53    Post subject: Add user to your forum ignore list Reply with quote

ja ne znam, meni formovi rade

Mr. Green

_________________
You need more bass.
Back to top
View user's profile Send private message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.01.2006 21:24    Post subject: Add user to your forum ignore list Reply with quote

@che: ma nijedan form ne radi, os kontakt, os guestbook, os upload slika u galeriju, nista...
evo ti kontakt ako ti to sto znaci... mada, sa kodom sve mora biti u redu jer je prije radilo
Code:
<?php
function showcontactform($name="", $email="", $website="http://", $subject="", $message="") {
   if(!$_SERVER['REMOTE_HOST']) {
      $host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
   } else {
      $host = $_SERVER['REMOTE_HOST'];
   }
   echo '<form action="' . $PHP_SELF . '" method="post" enctype="multipart/form-data">
   <p><label for="name">name</label>
   <input name="name" id="name" class="textfield" type="text" value="'.$name.'" size="50" maxlength="50" /></p>
   <p><label for="email">e-mail</label>
   <input name="email" id="email" class="textfield" type="text" value="'.$email.'" size="50" maxlength="50" /></p>
   <p><label for="website">website</label>
   <input name="website" id="website" class="textfield" type="text" value="'.$website.'" size="50" maxlength="50" /></p>
   <p><label for="subject">subject</label>
   <input name="subject" id="subject" class="textfield" type="text" value="'.$subject.'" size="50" maxlength="50" /></p>
   <p><label for="message">message</label>
   <textarea name="message" cols="50" rows="5" id="message">'.$message.'</textarea>
   <input type="hidden" name="ip" value="'.$_SERVER['REMOTE_ADDR'].'" />
   <input type="hidden" name="isp" value="'.$host.'" />
   <input type="hidden" name="browser" value="'.$_SERVER['HTTP_USER_AGENT'].'" /></p>
   <p><input class="button" type="submit" name="send" value="Send message" /></p>
    </form>';
}
echo '<h1>Contact</h1>';
if ($send) {
   $to = 'nelchee@inobscuro.com';
   $name = stripslashes($_POST['name']);
   $message = stripslashes($_POST['message']);
   $subject = stripslashes($_POST['subject']);
   $email = $_POST['email'];
   $website = $_POST['website'];
   if (!(($name) && ($message) && ($email))) {
      echo '<h2>Error!</h2><p>You didn\'t fill all the required fields (name, e-mail and message).</p>';
      showcontactform($name, $email, $website, $subject, $message);
   } elseif (!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$', $email)) {
      echo '<h2>Error!</h2><p>You didn\'t enter a valid e-mail address.</p>';
      showcontactform($name, $email, $website, $subject, $message);
   } else {
      $message .= "\n\n***********************************************************\n\nFrom: "
         . $name . "\nwww: " . $website . "\n\nIP: "
         . $_POST['ip'] . "\nISP: " . $_POST['isp'] . "\nbrowser: " . $_POST['browser'];
      $subject = "<!--in obscuro--> " . $subject;
      if (mail($to,$subject,$message, "From: " . $name . "<" . $_POST['email'] . "> \r\n"
      . "Reply-To:" . $_POST['email'] . "\r\n"
      ."Content-Type: text/plain; charset=UTF-8\r\n"
      ."X-Mailer: PHP/" . phpversion() )) {
         echo '<h2>Thank you!</h2>
               <p>Your message has been sent. I will try to respond as soon as I can.</p>
               <p>Return to <a href="http://inobscuro.com/">main page</a></p>';
      } else {
         echo '<h2>Error!</h2>
               <p>The message could not be sent. Please try again.</p><p>If the problem persists, click
               <a href="/contact/me/by/clicking/here/4nt1-5p4m/">here</a> to send e-mail through your mail client.</p>';
      }
   }
} else showcontactform();
?>



@carr: probala, nista. kao da se forma nije ni poslala.

@lekke: good4u Smile

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
ToDD



Joined: 05 May 2005
Posts: 83
Location: Zagreb

PostPosted: 31.01.2006 21:53    Post subject: Add user to your forum ignore list Reply with quote

$_HTTP_POST_VARS umjesto $_POST ??
Back to top
View user's profile Send private message MSN Messenger
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 31.01.2006 21:57    Post subject: Add user to your forum ignore list Reply with quote

da nije mozda
if ($send)

zapravo

if ($_POST['send'])

cinimise da ti jednostavno uopce ne uleti u taj if()

_________________
Bolje biti malo lud, nego malo pametan.
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.01.2006 22:04    Post subject: Add user to your forum ignore list Reply with quote

@ToDD: PHP5

@carr: ni to ne radi.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 31.01.2006 22:12    Post subject: Add user to your forum ignore list Reply with quote

nel`chee wrote:
@carr: ni to ne radi.

daj, sad vec lazes Smile

prvo probaj ovo
Code:
echo '<h1>Contact</h1>';
die('ja uopce ne udjem u file');
if ($_POST['send']) { ....


ako to proradi (tj. umre skripta) onda
Code:
if($_POST['send']){
die('ja sam usao uz if');...

da utvrdimo da li uopce on udje tamo gdje bi trebao.

ako se apsolutno nista od ovog ne dogodi onda editiramo krivi .php file.
tj.ili si ti pijana pa gledas krivi fajl Smile, ili mod_rewrite te je negdje grdo sjebao pa ga salje na krivi .php file.

_________________
Bolje biti malo lud, nego malo pametan.
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.01.2006 22:21    Post subject: Add user to your forum ignore list Reply with quote

ovako, prvo naravno da udje u pravi file. nisam ni trebala to provjeriti, ali sad sam vec u stanju sve probati pa jesam i, naravno, umre.

probala sam ubaciti kod iza if($send) i nakon sto kliknem na send ne dogodi se nista! opet imam isti form, prazan.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 31.01.2006 22:33    Post subject: Add user to your forum ignore list Reply with quote

nel`chee wrote:
ovako, prvo naravno da udje u pravi file. nisam ni trebala to provjeriti, ali sad sam vec u stanju sve probati pa jesam i, naravno, umre.

probala sam ubaciti kod iza if($send) i nakon sto kliknem na send ne dogodi se nista! opet imam isti form, prazan.

prazan je jer ti je ocito opet izgenerirao form jer je dosao do
Code:
} else showcontactform();

(mozes svejedno probat da u else ubacis die(),)

daj probaj prije if-a ubaciti
var_dump($_POST);
die;

pa vidi da li ti varijable uopce imaju ikakve vrijednosti, da li ti send varijabla ima uopce ista u sebi itd..
napisi nam ovdje sta ti outputa...

_________________
Bolje biti malo lud, nego malo pametan.
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.01.2006 22:40    Post subject: Add user to your forum ignore list Reply with quote

Code:
<h1>Contact</h1>array(9) {
  ["name"]=>
  string(7) "nelchee"
  ["email"]=>
  string(14) "nelchee@vip.hr"
  ["website"]=>
  string(21) "http://inobscuro.com/"
  ["subject"]=>
  string(4) "test"
  ["message"]=>
  string(5) "test2"
  ["ip"]=>
  string(14) "83.131.181.241"
  ["isp"]=>
  string(32) "83-131-181-241.adsl.net.t-com.hr"
  ["browser"]=>
  string(82) "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5"
  ["send"]=>
  string(12) "Send message"
}

evo sve je tu. ne kuzim.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.01.2006 23:02    Post subject: Add user to your forum ignore list Reply with quote

anyway, mozda je problem u verziji PHP-a, ovo je sve radilo na PHP4 a na PHP5 nece? googlam vec pola sata i nisam nasla nista vezano uz ovaj problem.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 31.01.2006 23:09    Post subject: Add user to your forum ignore list Reply with quote

ovo je vec preglupo da bi bilo al dobro
Code:
if($_POST['send']=='Send message'){
die("daj proradi vise");
...

_________________
Bolje biti malo lud, nego malo pametan.
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.01.2006 23:41    Post subject: Add user to your forum ignore list Reply with quote

aargh. evo radi sad, uz jos neke prepravke (jer se varijabla kojoj nije nista dodjeljeno u PHP5 ne tretira kao prazna!). i usput sam imala typo.

Last edited by nel`chee on 01.02.2006 00:49; edited 1 time in total

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
r3dsc0rpi0n



Joined: 20 Apr 2005
Posts: 354
Location: Zagreb

PostPosted: 01.02.2006 00:49    Post subject: Add user to your forum ignore list Reply with quote

Very Happy

evo ti hint

http://www.mi3dot.org/forum/viewtopic.php?t=7635

Laughing

_________________
::: Fortis est, qui se vincit ! ::::
Back to top
View user's profile Send private message Send e-mail Visit poster's website Twitter profile
Tedius



Joined: 22 Dec 2003
Posts: 149
Location: Zagreb

PostPosted: 01.02.2006 00:58    Post subject: Add user to your forum ignore list Reply with quote

khm Very Happy
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 01.02.2006 01:00    Post subject: Add user to your forum ignore list Reply with quote

ARGH! WTF???
Quote:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/nelchee/public_html/index.php:19) in /home/nelchee/public_html/guestbook.php on line 104

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/nelchee/public_html/index.php:19) in /home/nelchee/public_html/guestbook.php on line 104

pa ne mogu to drugdje premjestiti Evil or Very Mad

dakle, imam ovo u index.php
Quote:
header("Content-Type: $mime;charset=$charset");
header("Vary: Accept");

sto da sad radim? da jednostavno ne saljem te headere nego ostavim samo ono u HTML-u? ali ovako mi u infu fajla pise da je text/html, god koje komplikacije ><

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Tedius



Joined: 22 Dec 2003
Posts: 149
Location: Zagreb

PostPosted: 01.02.2006 02:19    Post subject: Add user to your forum ignore list Reply with quote

Headere saljes prije bilo kakvog outputa prema browseru, dakle prvo headeri sessioni i sli.
Provjeri guestbook.php, pise ti i koja linija, ili ces morati razmjestiti poredak skripti koje includas ili ces ih morati zatvoriti sa ob_start i ob_flush, vise o tome u php manualu...
Back to top
View user's profile Send private message Visit poster's website
carr



Joined: 13 Nov 2003
Posts: 1397
Location: Karlovac

PostPosted: 01.02.2006 02:25    Post subject: Add user to your forum ignore list Reply with quote

za sve te komplikacije oko outputa prije cookiea najbolje je iskoristiti output buffer i jednom zauvijek si mirna s tim problemom.

dobar primjer za upotrebu istoga imas ovdje na mi3-u, u tutorialu za višejezični sajt preko php-a.

ovako se moras drkat sa razmicanjem skripti i outputova po cijelom sajtu.

_________________
Bolje biti malo lud, nego malo pametan.
Back to top
View user's profile Send private message Visit poster's website
lekke



Joined: 17 Jun 2004
Posts: 860
Location: 25th floor

PostPosted: 01.02.2006 02:29    Post subject: Add user to your forum ignore list Reply with quote

nelchee je moj #1 programer

_________________
You need more bass.
Back to top
View user's profile Send private message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 01.02.2006 12:47    Post subject: Add user to your forum ignore list Reply with quote

@Tedius, carr: okej, proucila sam malo ovo i cini mi se da bi u biti trebala potpuno promijeniti nacin generiranja stranica... cega ima malo previse, a i pitanje je jesam li dobro shvatila. zato sam samo dodala ob_start() i ob_end_flush() na krajeve index.php i sada radi Confused

@lekke: nemoj mi se rugati Mad

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 01.02.2006 13:00    Post subject: Add user to your forum ignore list Reply with quote

nel`chee wrote:
@Tedius, carr: okej, proucila sam malo ovo i cini mi se da bi u biti trebala potpuno promijeniti nacin generiranja stranica... cega ima malo previse, a i pitanje je jesam li dobro shvatila. zato sam samo dodala ob_start() i ob_end_flush() na krajeve index.php i sada radi Confused


yep.

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group