php.de

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

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 03.11.2004, 21:01  
Gast
 
Beiträge: n/a
Standard Hochkommata nicht möglich?

Hallo.

Ich habe auf meiner HP ein Formular, dessen Daten in eine SQL Datenbank geschrieben werden sollen. Nur, wenn auch nur ein ' dort erscheint, wird der gesamte Datensatz nicht in Datenbank geschrieben. Warum? Wenn ich das mit PHPMyAdmin mache, klappt es reibunglos...

erfassen.php
Code:
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Songtext hinzufügen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body,td,th {
	color: #000000;
}
-->
</style></head>
<body>
<h2></h2>


</p>


</p>


</p>
<?php
require("connect.php");
include("counting.php");
include("../layout/navi.inc.php");

$vorname=$_POST["vorname"];
$nachname=$_POST["nachname"];
$songtitel=$_POST["songtitel"];
$songtext=$_POST["songtext"];
$album=$_POST["album"];
$poster=$_POST["poster"];

$sql1="INSERT INTO lyrics (vor,name,titel,text,album,autor) VALUES ('$vorname','$nachname','$songtitel','$songtext','$album','$poster')";
mysql_query($sql1);
mysql_close();
?>



Ihr Songtext wurde aufgenommen!

</body>
</html>
hinzufuegen.php
Code:
<?php
include("connect.php");
include("counting.php");
include("../layout/navi.inc.php");
?>



<html>
<head>
<title>Songtext hinzuf&uuml;gen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	background-image: url(../layout/background.jpg);
	background-color: #FFFFFF;
}
body,td,th {
	font-family: Courier New, Courier, mono;
	font-size: 12px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>


</p>


</p>


</p>


</p>
<p align="center"></p>

<form method="POST" action="erfassen.php">
  <table width="743" height="47" border="0">
    <tr>
      <td width="275" height="17">

Vorname        </td>
      <td width="458">Nachname oder Bandname </td>
    </tr>
    <tr>
      <td height="24"><input name="vorname" type="text" size="40" maxlength="80"></td>
      <td><input name="nachname" type="text" size="40" maxlength="80"></td>
    </tr>
  </table>
    <table width="742" border="0">
    <tr>
      <td width="736">Songtitel</td>
    </tr>
    <tr>
      <td><input name="songtitel" type="text" size="40" maxlength="80"></td>
    </tr>
  </table>
    <table width="200" border="0">
      <tr>
        <td>Songtext</td>
      </tr>
      <tr>
        <td><textarea name="songtext" cols="70" rows="15"></textarea></td>
      </tr>
    </table>
    

ACHTUNG: Derzeit ist es noch nicht m&ouml;glich Hochkommata ( ' ) in den Texten zu verwenden!!! </p>
    <table width="692" border="0">
      <tr>
        <td width="686">Aus dem Album </td>
      </tr>
      <tr>
        <td><input name="album" type="text" size="40" maxlength="80"></td>
      </tr>
    </table>
    

</p>
    <table width="689" border="0">
      <tr>
        <td width="683"><div align="center">Dieser Songtext wurde gepostet von... </div></td>
      </tr>
      <tr>
        <td><div align="center">
          <input name="poster" type="text" size="40" maxlength="80">
        </div></td>
      </tr>
    </table>
  


    <input type="submit" name="submit" value="submit">
</p>
</form>
	

  
</body>
</html>
Danke im voraus
 
Sponsor Mitteilung
PHP Code Flüsterer

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

Alt 03.11.2004, 21:05  
Gast
 
Beiträge: n/a
Standard

Guckst Du:
http://de2.php.net/manual/de/function.stripslashes.php
http://de2.php.net/manual/de/functio...ape-string.php

Gruß
phpfan
 
Alt 03.11.2004, 21:05  
Gast
 
Beiträge: n/a
Standard

@phpfan meintest du wirklich stripslashes oder vielleicht erstmal addslashes?
 
Alt 03.11.2004, 21:07  
Gast
 
Beiträge: n/a
Standard

Nein, ich meine stripslashes, denn das Hochkomma kommt vom Formular als \'
Gruß
phpfan
 
Alt 03.11.2004, 21:33  
Gast
 
Beiträge: n/a
Standard

Danke, hat geklappt!
 
Alt 03.11.2004, 21:38  
Gast
 
Beiträge: n/a
Standard

Danke, hat geklappt!
 
 


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
[Erledigt] Assoziative Arrays - Key in Hochkommata oder nicht? Wolla PHP Tipps 2008 6 07.06.2008 17:45

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
hochkomma in sql, hochkomma sql, php hochkommata, sql hochkomma, php hochkomma, php sql textarea hochkomma, http://www.php.de/php-tipps-2004/11681-hochkommata-nicht-moeglich.html, php post hochkomma, sql hochkommata, hochkommata php, sql hochkomma im text, sql in hochkomma, html _post hochkomma, php include hochkomma, hochkomma php, $_post hochkomma, php formular hochkomma sql, hochkomma in sql eintragen, hochkommainsql, sql ohne hochkomma

Alle Zeitangaben in WEZ +2. Es ist jetzt 02:12 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.