<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Errore variabile category]]></title><description><![CDATA[<p dir="auto">Ciao a tutti, ho un errore con una variabile che invece sembrerebbe essere settata benissimo, eccovi il file:</p>
<pre><code>&lt;?php 
include("connessione.inc");
$title=$_POST["title"];
$tag1=$_POST["tag1"];
$tag2=$_POST["tag2"];
$tag3=$_POST["tag3"];
$category=$_POST["category"];
$description=$_POST["description"];
$who_see=$_POST["who_see"];
$target_path="uploads/";
$date=date("j/M/Y");
$target_path = $target_path.basename( $_FILES['fileUtente']['name']); 
function control ($title, $tag1, $tag2, $tag3, $description){
   $result=true;
if ($title=="" or $tag1=="" or $tag2=="" or $tag3=="" or $category=="" or $description=="" or $who_see==""){
   $result=false;
} return $result;
}
if (control ($title, $tag1, $tag2, $tag3, $description) == true){
if  ($_FILES['fileUtente']['error'] == 0) {
   move_uploaded_file($_FILES['fileUtente']['tmp_name'], $target_path);
      echo "File ".basename( $_FILES['uploadedfile']['name'])." has been uploaded.&lt;/br&gt; Now you have to wait that the administrator approve it.";   
     	   echo "&lt;a href='upload.php'&gt;Upload another image.&lt;/a&gt;";   
$sql="INSERT INTO opere(title, tag1, tag2, tag3, category, description, who_see) VALUES('$title','$Tag1', '$Tag2', '$Tag3', '$category', '$description', '$who_see', '$target_path')";
mysql_query($sql,$conn) or die("Errore!".mysql_error());
	}
   else   {
	    echo "Error in the process, try it again!";
	 }
}
else { echo "&lt;/br&gt;Missing data&lt;/br&gt;"; }
?&gt;

</code></pre>
<p dir="auto">ed ecco l'errore:</p>
<p dir="auto">Notice: Undefined variable: category in C:\Program Files\EasyPHP-5.3.2\www\Sito\uploadOpera.php on line 60</p>
<h2>Missing data</h2>
<p dir="auto">A me sembra tutto ok, è la pagina che viene quando clicco sul bottone per inviare un'immagine, vi metto anche l'altra pagina:</p>
<pre><code>&lt;?php 
include("connessione.inc");
function autorizza(){
   if ((isset($_SESSION['login']))&amp;&amp;((isset($_SESSION['password'])))){
	    echo &lt;&lt;&lt;MESS
			&lt;p&gt;You have logged in and you can submit a file.&lt;/p&gt;&lt;/br&gt;
&lt;p&gt;&lt;b&gt;Choose Sketch:&lt;/b&gt;
&lt;FORM enctype="multipart/form-data" action="uploadOpera.php" id="uploadOpera" method="POST" name="modulo"&gt;
 &lt;input name="fileUtente" type="file" maxlength="1000"&gt;&lt;/p&gt;
&lt;/br&gt;
&lt;p&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/br&gt;
Insert the title:&lt;br&gt;
&lt;input type="text" name="title"&gt;
&lt;/br&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Insert tags&lt;/b&gt;:&lt;/br&gt;
&lt;input name="tag1" type="text" size="20" maxlength="30"&gt;&lt;/br&gt;
&lt;input name="tag2" type="text" size="20" maxlength="30"&gt;&lt;/br&gt;
&lt;input name="tag3" type="text" size="20" maxlength="30"&gt;&lt;/label&gt;
&lt;/br&gt;
&lt;/p&gt;&lt;p&gt;
 &lt;b&gt;Category&lt;/b&gt;&lt;/br&gt;
 &lt;input type="radio" name="category" value="nature" checked="checked"/&gt;Nature
 &lt;input type="radio" name="category" value="people"/&gt;People 
 &lt;br&gt;
 &lt;input type="radio" name="category" value="animal"/&gt;Animal
 &lt;input type="radio" name="category" value="other"/&gt;Other
&lt;/p&gt;
	&lt;/br&gt;
&lt;p&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/br&gt;Describe your sketch:&lt;/br&gt;
   &lt;textarea name="description" cols="40" rows="10" maxlength="300" onkeyup="ContaCaratteri()"&gt;
&lt;/textarea&gt;
&lt;input type="text" name="conta" readonly&gt;
&lt;/p&gt;
	&lt;/br&gt;
	&lt;/br&gt;
	&lt;p&gt;&lt;b&gt;Who can see this sketch?&lt;/b&gt;&lt;/br&gt;
   &lt;select name="who_see" &gt;
	 &lt;option value="1" selected="selected"&gt;All users&lt;/option&gt;
	 &lt;option value="0"&gt;Only friends&lt;/option&gt;
  &lt;/select&gt;&lt;/p&gt;
	&lt;/br&gt;
	&lt;/br&gt;
  &lt;button type="submit"&gt;
   submit
 &lt;/button&gt;
MESS;
}
	 else {
	    echo "&lt;p&gt;We are sorry, you need to login to submit a file!&lt;/p&gt;";
	 }
}
echo autorizza();
?&gt;
</code></pre>
<p dir="auto">Sapete aiutarmi? Ve ne sarei infinitamente grata <img src="https://connect.gt/plugins/nodebb-plugin-emoji/emoji/android/1f604.png?v=gca7n9pp8gc" class="not-responsive emoji emoji-android emoji--smile" title=":D" alt="😄" /></p>
]]></description><link>https://connect.gt/topic/148525/errore-variabile-category</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 07:15:39 GMT</lastBuildDate><atom:link href="https://connect.gt/topic/148525.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Mar 2011 20:19:47 GMT</pubDate><ttl>60</ttl></channel></rss>