Jump to content

Recommended Posts

Why wont this work?

 

<html>

<body>



<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');



if ($submit) {

$stg2 = 'gallery/'.$_POST['stg2'];
  // process form

  $db = mysql_connect("localhost", "photomagik", "----");

  mysql_select_db("photomagik_co_nz_-_soho",$db);
  


  $sql = "UPDATE mag  set on='$on',stg1='$stg1',stg2='$stg2',stg3='$stg3' WHERE id='$nm'";



  $result = mysql_query($sql);
  
  //echo $sql;

  echo "Thank you! Information entered. <a href=edit.php>Back...</a>\n";

} else{



  // display form



  ?>



  <form method="post" action="<?php echo $PHP_SELF?>">
  
    <p>1:
      <input name="nm" type="checkbox" value="1">
      <br />
  
  2:
  <input name="nm" type="checkbox" value="2">
  <br />
  
  3:
  <input name="nm" type="checkbox" value="3">
  <br />
  
  4:
  <input name="nm" type="checkbox" value="4">
  <br />
  
  5:
  <input name="nm" type="checkbox" value="5">
  <br />
  
  6:
  <input name="nm" type="checkbox" value="6">
  <br />

  Link
  <input type="Text" name="stg2">
  <br>

  Image
  <input type="Text" name="stg1">
  <br>

  Text
  <input type="Text" name="stg3">
  </p>
    <p>Activate? Yes 
     <input name="on" type="checkbox" value="1">
      <br>
      <input type="Submit" name="submit" value="Enter information">
        </p>
  </form>



  <?php



} // end if



?>



</body>



</html>

Link to comment
https://forums.phpfreaks.com/topic/51025-very-simple-cms/
Share on other sites

What is the result when you try to run this

script?

 

I am trying to update that database - i dont really get it.

 

$stg2 = 'gallery/'.$_POST['stg2'];

  $sql = "UPDATE mag  set on='$on',stg1='$stg1',stg2='$stg2',stg3='$stg3' WHERE id='$nm'";

 

Where u set ur form fields like:

$stg1,$stg3,$on,$nm...

 

From where it will be insert to db.

 

I don't get what you mean?

Link to comment
https://forums.phpfreaks.com/topic/51025-very-simple-cms/#findComment-251093
Share on other sites

 

$stg2 = 'gallery/'.$_POST['stg2'];

$sql = "UPDATE mag  set on='$on',stg1='$stg1',stg2='$stg2',stg3='$stg3' WHERE id='$nm'";

 

Where u set ur form fields like:

$stg1,$stg3,$on,$nm...

 

I mean u want to update ur table with variables like: $stg1,$on and so on...

U just mention one variable which is $stg2.But from where the others u want to update.

 

 

Link to comment
https://forums.phpfreaks.com/topic/51025-very-simple-cms/#findComment-251094
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.