Jump to content

Recommended Posts

im designin an "e-bay" like site and i need to do a page where administrator can activate or deactivate some pods.. so far im doing ok.. but have soe trouble with that page.. heres y code... the administrator writes de code of the post and click the button to search 4 it.. it fouds and then click a 2nd button to activate it means write an "1" in a field called "activo"... BUT IT DOESNT...

 

<?php

 

if(isset($_POST['button_a'])){

$lacla = $_POST['anucod'];

mysql_query("UPDATE anuncios SET activo=1 WHERE clave='$lacla'") or die(mysql_error());

}

?>

 

<?php

if(isset($_POST['button'])){

$lacla = $_POST['anucod'];

$lacla2=trim('$lacla');

mysql_select_db($database_clasif, $clasif);

$cuerye="select * from anuncios where clave='$lacla'";

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

$row_anuncios = mysql_fetch_assoc($result);

$totalRows_anuncios = mysql_num_rows($result);

if (mysql_num_rows($result) > 0) {

//User exists

?>

<form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<p>

<input type="text" name="anucod" id="anucod" />

<input type="submit" name="button_a" id="button_a" value="ACTIVATE POST" />

</p>

<?php

echo "<br>";

echo "<br>";

echo "<br>";

echo "<br>";

echo "<br>________________________________________________________";

?>

</form>

<?php

} else {

//User does not exist

echo '0';

}

}

?>

<form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<p>

<input type="text" name="anucod" id="anucod" />

<input type="submit" name="button" id="button" value="enter post code..." />

</p>

</form>

</body>

Link to comment
https://forums.phpfreaks.com/topic/269870-help-pls-find-update/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.