You are here: Re: Approving Items « PHP Programming Language « IT news, forums, messages
Re: Approving Items

Posted by Pedro Graca on 10/23/06 19:17

James54321 wrote:
> Ok I have modified it like you said but i still have the same problem
> NONE of the code is executed (even the echo("something is said here");)
> doesnt work so i dont think the function is being called corectly
> ...but I have no idea why ...if you do please tell me.
>
> Below is my revised code:

I took the liberty to reformat your code a little bit (!).
First pass through it was to indent properly.
Here's a very stripped down result:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

<?php
displayIdeas();

function displayIdeas()
{
while ($row = mysql_fetch_row($result)) {
{
if ($rowcounter == '1') {
} else {
}
}
foreach($row as $data) print "\n\t<td> {$data} </td>";
}
}
//function closed

if (isset($_POST['submit'])) {
//this is where the code i need should go :)
foreach ($_POST['id'] as $key => $value) {
switch ($value) {
}
}

//close connection
mysql_close($connection);

function submission_approve($key)
{
}

function submission_delete($key)
{
}

function submission_ban($key)
{
}
}

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

What you have to do is move the functions to their right place in the
structure of the script. I like to have all functions at the top of the
file, but you can have them anywhere you prefer. Even better is to have
them in a separate file and include it in scripts that need those
functions.


You still use some variables that do not exist.
Add

error_reporting(E_ALL);

to the very top of your script, right after the <?php opening tag so
that PHP complains about them and you can correct the mistake


*INDENT* your code properly! It will help you tremendously.

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация