php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 07.10.2004, 12:46  
Gast
 
Beiträge: n/a
Standard Problem mit Variable bei Formular auf lokalem Rechner

Hi,
habe mir eben einfach mal ein Formular geschrieben um Daten schneller in eine Datenbank einzufügen. Alles auf meinem eigenen PC (localhost).

Code:
if($sent == 1)
{
  $insert = "insert into artikel
             values($artnr, '$bez', '$besch', '$preis', '$kategorie', $anzahl, '$bild')";

  $result = pg_query($db, $insert);

  if(!$result)
  {
    echo $sent;
    echo "Artikel konnte nicht eingefügt werden!";
    unset($sent);

  }
  else
  {
    echo "Artikel eingepflegt!!!";
    unset($sent, $artnr, $bez, $besch, $preis, $kategorie, $anzahl, $bild);
  }
}
else
{
?>

<div id="main_text" style="position:absolute; width: 400px; left: 150px; top: 100px; z-index:0;">
  <form action="<? echo $PHP_SELF; ?>" method="post">
    <input type="hidden" name="sent" value="1">
      <table>
        <tr>
          <td>
            Artikelnummer:
          </td>
          <td>
            <input type="Text" name="artnr" value="<? echo $artnr; ?>" size="10">
          </td>
        </tr>
        <tr>
          <td>
            Bezeichnung:
          </td>
          <td>
            <input type="Text" name="bez" value="<? echo $bez; ?>" size="40">
          </td>
        </tr>
        <tr>
          <td valign="top">
            Beschreibung:
          </td>
          <td>
            <textarea name="text" rows="5" cols="40" wrap="virtual"><? echo $besch; ?></textarea>
          </td>
        </tr>
        <tr>
          <td>
            Preis:
          </td>
          <td>
            <input type="Text" name="preis" value="<? echo $preis; ?>" size="9">
          </td>
        </tr>
        <tr>
          <td>
            Kategorie:
          </td>
          <td>
            <input type="Text" name="kategorie" value="<? echo $kategorie; ?>" size="30">
          </td>
        </tr>
        <tr>
          <td>
            Anzahl:
          </td>
          <td>
            <input type="Text" name="anzahl" value="<? echo $anzahl; ?>" size="5">
          </td>
        </tr>
        <tr>
          <td>
            Bild:
          </td>
          <td>
            <input type="Text" name="bild" value="<? echo $bild; ?>" size="15">
          </td>
        </tr>
        <tr>
          <td colspan="2">
          </td>
        </tr>
        <tr>
          <td colspan="2" align="right">
            <input type="submit" name="submit" value="send">
          </td>
        </tr>
      </table>
  </form>
</div>

<?
}
?>
Nur warum wird bitte $sent nicht auf 1 gesetzt wenn ich den Button betätige? Ich habe damals ein ähnliches Formular gemacht und es hat sofort funktioniert. Das lustige ist ja auch, wenn ich diese PHP-Datei online bei meinem Webspace Anbieter teste läuft es. Sprich die $sent Variable wird gesetzt. Warum aber macht der das nicht auf meinem lokalen PC??? Muss da noch irgendwas einstellen???

Danke schon einmal im Vorraus!!!
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 07.10.2004, 12:50  
Gast
 
Beiträge: n/a
Standard

if($_POST['sent'] == 1)
 
Alt 07.10.2004, 13:17  
Gast
 
Beiträge: n/a
Standard

http://de3.php.net/register_globals

lesen.
 
Alt 07.10.2004, 15:17  
Gast
 
Beiträge: n/a
Standard

Danke für die schnelle Hilfe!!!
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Problem mit IF und Formular Black-Devil PHP Tipps 2008 12 03.03.2008 17:54
Variable zurück an Formular schicken ?!?!? TeazY PHP Tipps 2008 5 18.12.2007 20:07
Formular Problem im IE HTML, Usability und Barrierefreiheit 19 18.01.2006 13:29
[Erledigt] Problem mit dem Füllen einer Tabelle über Formular PHP Tipps 2006 18 10.01.2006 12:51
php Aufruf von Formular und Übergabe einer Variable (get) PHP Tipps 2007 10 30.12.2005 16:45
[Erledigt] Variable ohne Formular &quot;weiterschicken&quot; PHP Tipps 2007 15 21.12.2005 15:49
problem mit variable snatch-ic PHP Tipps 2007 5 13.12.2005 13:18
Problem mit Formular! PHP Tipps 2005-2 5 12.08.2005 19:20
Formular variable gestallten PHP Tipps 2005-2 2 03.08.2005 12:03
Problem mit Formular PHP Tipps 2005-2 4 14.07.2005 23:53
variable ohne formular übergeben nautiluS PHP Tipps 2005 9 11.04.2005 13:46
Problem mit Formular übergabe b++ PHP Tipps 2005 6 04.04.2005 14:19
Problem mit Formular + Antwortseite PHP Tipps 2004 2 22.07.2004 09:51
[Erledigt] Formular, Submit, PHP - Hab ein kleines Problem PHP Tipps 2004 2 10.07.2004 13:50
Locales PHP Problem Formular Daten PHP Tipps 2004 6 11.06.2004 15:44

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
variabel rechner, variablen rechner, variable rechner, variabler rechner, variabelrechner, online rechner mit variablen, online variablen rechner, variabel rechner online, variablen rechner online, rechner variablen online, variabelnrechner, variable rechner online, formular rechner php, zahlen variabel rechner, php rechnen mit variablen post, online rechner variablen, variabel rechnen, variablen online rechner, rechner online mit variablen, formular input post pg_query insert into

Alle Zeitangaben in WEZ +2. Es ist jetzt 00:16 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.