Search Webmaster Help and Solution

Call to undefined function n12br()

Hello everyone Guys,

Im new here...... i need help. i cant go away from day with a script in PHP;

The script moviedit.php gave me this error:

Fatal error: Call to undefined function n12br() in /var/www/Blockbuster/Convalida/moviedit1.php on line 68

i checked the code but i cant understand where is the error..where i wrong? someone help me please. The variable $_GET[error] come correctly as the URL show.

I test already the page and apart this error is perfectly running but from when i did the modify it doesnt work properly;

i post the code of the page and the url from where the variables came:

http://localhost/Blockbuster/Convali...21%OD%OA&id=57

PHP Code: <?php
$connessione = mysql_connect(localhost, xxx, xxx) or die ( mysql_error());
mysql_select_db(Blockbuster) or die ( mysql_error());
?>

<?php
$moviesql = SELECT id_attore, nome_attore FROM ATTORI;
$result = mysql_query($moviesql) or die ( Invalid Query: . mysql_error());
while($row = mysql_fetch_array($result)) {
$people[$row[id_attore]] = $row[nome_attore];
}

switch ($_GET[action]) {

case edit :

                            $moviesql = SELECT * FROM FILM WHERE id_film = .$_GET[id].;

                            $result = mysql_query($moviesql) or die(mysql_error());

                            $row = mysql_fetch_array($result);

                            $nome_film = $row[nome_film];
                      
                            $genere_film = $row[genere_film];

                            $anno_prod = $row[anno_prod];

Break;

default:

                            $nome_film = ;
                          
                            $genere_film = ;

                            $anno_prod = ;

Break;

                          }

?>

<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv=Content-Type content=text/html; charset=UTF-8 />

<title><?php echo $_GET[action]; ?> Movie</title>

<style type=text/css>
TD{ color:#353535; font-family:Verdana, Geneva, sans-serif}
TH{ color:#FFFFFF; font-family:Verdana, Geneva, sans-serif; background-color:#336699}
</style>

</head>

<body>

<form action=Commit3.php?action=<?php echo $_GET[action]; ?>&type=movie&id=<?php if(isset($_GET[id])) { echo $_GET[id]; } ?> method=post>

<?php

if (!empty($_GET[error]))
{
echo <div align=center .
style=color:#FFFFFF; background-color:#FF0000; .
font-weight:bold> . n12br(urldecode($_GET[error])) .
</div><br />;
}
?>

<h3 align=center> Pannello di Inserimento Film</3> <br>

<table width=750 border=1 cellspacing=1 cellpadding=3 bgcolor=353535 align=center>

<tr>
     <td width=30% bgcolor=#FFFFFF> Titolo </td>
     <td width=70% bgcolor=#FFFFFF>
     <input type=text name=movie_name value=<?php echo $nome_film; ?>>
     </td>
</tr>

<tr>
     <td width=30% bgcolor=#FFFFFF>
     Genere
     </td>
     <td width=70% bgcolor=#FFFFFF>
     <input type=text name=movie_type value=<?php echo $genere_film; ?>>
     </td>
</tr>

<tr>
     <td width=30% bgcolor=#FFFFFF>
     Durata (Min)
     </td>
     <td width=70% bgcolor=#FFFFFF>
     <input type=text name=durata_film>
     </td>
</tr>



<tr>
     <td bgcolor=#FFFFFF>Movie Year</td>
     <td bgcolor=#FFFFFF>
                 
                     <select name=movie_year>
                     <option value= selected> Selected a Year..</option>
                     <?php for($year = date(Y); $year>=1970; $year--) {
                     if($year == $anno_prod) { $selected = selected; } else { $selected = ; } ?>
                     <option value=<?php echo $year; ?><?php echo $selected; ?> >
                     <?php echo $year; ?></option>
                     <?php } ?>
                     </select>
     </td>
</tr>

<tr>
      <td bgcolor=#FFFFFF>Attore Protagonista</td>
      <td bgcolor=#FFFFFF>
                     <select name=nome_attore>
                     <option value= selected> Seleziona un Attore</option>
                     <?php foreach ($people as $id_attore => $nome_attore) { ?>
                     <option value=<?php echo $id_attore; ?>><?php echo $nome_attore; ?> </option>
                     <?php } ?>
                     </select>
      </td>
</tr>

<tr>
      <td bgcolor=#FFFFFF colspan=2 align=center>
      <input type=submit name=SUBMIT value=<?php echo $_GET[action]; ?> >
      </td>
</tr>
</table>
</body>
</html> if is necessry i post the other part of code.. like commit3.php the page from where the variable came;

Thanks in advance

Daniele Hello everyone Guys,

Im new here...... i need help. i cant go away from day with a script in PHP;

The script moviedit.php gave me this error:

Fatal error: Call to undefined function n12br() in /var/www/Blockbuster/Convalida/moviedit1.php on line 68

i checked the code but i cant understand where is the error..where i wrong? someone help me please. The variable $_GET[error] come correctly as the URL show.

I test already the page and apart this error is perfectly running but from when i did the modify it doesnt work properly;

i post the code of the page and the url from where the variables came:

http://localhost/Blockbuster/Convali...21%OD%OA&id=57

PHP Code: <?php
$connessione = mysql_connect(localhost, xxx, xxx) or die ( mysql_error());
mysql_select_db(Blockbuster) or die ( mysql_error());
?>

<?php
$moviesql = SELECT id_attore, nome_attore FROM ATTORI;
$result = mysql_query($moviesql) or die ( Invalid Query: . mysql_error());
while($row = mysql_fetch_array($result)) {
$people[$row[id_attore]] = $row[nome_attore];
}

switch ($_GET[action]) {

case edit :

                            $moviesql = SELECT * FROM FILM WHERE id_film = .$_GET[id].;

                            $result = mysql_query($moviesql) or die(mysql_error());

                            $row = mysql_fetch_array($result);

                            $nome_film = $row[nome_film];
                      
                            $genere_film = $row[genere_film];

                            $anno_prod = $row[anno_prod];

Break;

default:

                            $nome_film = ;
                          
                            $genere_film = ;

                            $anno_prod = ;

Break;

                          }

?>

<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv=Content-Type content=text/html; charset=UTF-8 />

<title><?php echo $_GET[action]; ?> Movie</title>

<style type=text/css>
TD{ color:#353535; font-family:Verdana, Geneva, sans-serif}
TH{ color:#FFFFFF; font-family:Verdana, Geneva, sans-serif; background-color:#336699}
</style>

</head>

<body>

<form action=Commit3.php?action=<?php echo $_GET[action]; ?>&type=movie&id=<?php if(isset($_GET[id])) { echo $_GET[id]; } ?> method=post>

<?php

if (!empty($_GET[error]))
{
echo <div align=center .
style=color:#FFFFFF; background-color:#FF0000; .
font-weight:bold> . n12br(urldecode($_GET[error])) .
</div><br />;
}
?>

<h3 align=center> Pannello di Inserimento Film</3> <br>

<table width=750 border=1 cellspacing=1 cellpadding=3 bgcolor=353535 align=center>

<tr>
     <td width=30% bgcolor=#FFFFFF> Titolo </td>
     <td width=70% bgcolor=#FFFFFF>
     <input type=text name=movie_name value=<?php echo $nome_film; ?>>
     </td>
</tr>

<tr>
     <td width=30% bgcolor=#FFFFFF>
     Genere
     </td>
     <td width=70% bgcolor=#FFFFFF>
     <input type=text name=movie_type value=<?php echo $genere_film; ?>>
     </td>
</tr>

<tr>
     <td width=30% bgcolor=#FFFFFF>
     Durata (Min)
     </td>
     <td width=70% bgcolor=#FFFFFF>
     <input type=text name=durata_film>
     </td>
</tr>



<tr>
     <td bgcolor=#FFFFFF>Movie Year</td>
     <td bgcolor=#FFFFFF>
                 
                     <select name=movie_year>
                     <option value= selected> Selected a Year..</option>
                     <?php for($year = date(Y); $year>=1970; $year--) {
                     if($year == $anno_prod) { $selected = selected; } else { $selected = ; } ?>
                     <option value=<?php echo $year; ?><?php echo $selected; ?> >
                     <?php echo $year; ?></option>
                     <?php } ?>
                     </select>
     </td>
</tr>

<tr>
      <td bgcolor=#FFFFFF>Attore Protagonista</td>
      <td bgcolor=#FFFFFF>
                     <select name=nome_attore>
                     <option value= selected> Seleziona un Attore</option>
                     <?php foreach ($people as $id_attore => $nome_attore) { ?>
                     <option value=<?php echo $id_attore; ?>><?php echo $nome_attore; ?> </option>
                     <?php } ?>
                     </select>
      </td>
</tr>

<tr>
      <td bgcolor=#FFFFFF colspan=2 align=center>
      <input type=submit name=SUBMIT value=<?php echo $_GET[action]; ?> >
      </td>
</tr>
</table>
</body>
</html> if is necessry i post the other part of code.. like commit3.php the page from where the variable came;

Thanks in advance

Daniele

View Complete Thread with Replies

Related Items

Query failed: connection to localhost:3354 failed (errno=111, msg=Connection refused).