Jump to content


Photo
- - - - -

News CMS Script


  • This topic is locked This topic is locked
26 replies to this topic

#21 abosaleh

abosaleh

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 12 May 2007 - 03:40 AM

and here is the delete_ac.php

<?
include('dbconnect.php'); //connects to database

// get value of id that sent from address bar
$id=$_GET['id'];


// Delete data in mysql from row that has this id
$sql="DELETE FROM newscms WHERE id='$id'";
$result=mysql_query($sql);


// if successfully deleted
if($result){
echo "<center><b><br>";
echo "Deleted Successfully";
echo "<BR>";
echo "<a href='delete.php'>Back to main page</a>";
}


else {
echo "ERROR";
}


// close connection
mysql_close();


?>



Edited by abosaleh, 12 May 2007 - 03:45 AM.


#22 boyis92

boyis92

    Young Padawan

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Melborne

Posted 03 June 2007 - 09:06 AM

ah i like

#23 artlover

artlover

    Young Padawan

  • Members
  • Pip
  • 12 posts

Posted 08 June 2007 - 05:17 AM

Thank you for the Script and your time, Appreciate your time.

#24 α∂αмяoss

α∂αмяoss

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 2,102 posts
  • Gender:Male
  • Location:$_SERVER['REMOTE_ADDR']
  • Interests:football, Manchester Utd., coding, web developement, business, girls and warcraft.

Posted 09 June 2007 - 05:48 PM

Nice one! Too bad i have an better copy of it.


Was that really needed? If you dont have anything constructive to say than why post at all? Anyways. Im loving the script so far. Will do a great job for anyone. Keep it up :rolleyes:

#25 curthard89

curthard89

    Young Padawan

  • Members
  • Pip
  • 226 posts

Posted 10 July 2007 - 02:38 AM

not a tutorial to is it really, people get mis conception and just say, add this to this page, add that to that, wheres the days of step 1, 1st we add this line which does blablabla lol

#26 Varis

Varis

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 04 July 2008 - 07:51 AM

wow, it works well :) thankx.

#27 CSB

CSB

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 16 July 2008 - 09:48 AM

heres a random edit page I created due to bordem :popcorn: untested.

<?php
include('dbconnect.php'); //connects to database

//select the table
$result = mysql_query("select * from newscms order by id desc LIMIT 5 ");

//grab all the content from the table
while($r = mysql_fetch_array($result))
{
$id = $r['id'];
$title = $r['title'];
$date = $r['date'];
$user = $r['user'];
$icon = $r['icon'];
$message = $r['message'];

}

// the input fields for editing

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<h1>Edit Tutorial #<?php echo $row[0]; ?></h1>
<input type="hidden" name="id" value="<?php echo $id; ?>">
<h2>Title</h2>
<input name="title" type="text" value="<?php echo $title ?>" size="50"><br>
<h2>Date</h2>
<input name="date" type="text" value="<?php echo $date ?>" size="50">
<h2>User</h2>
<input name="user" type="text" value="<?php echo $user ?>" size="50"><br><br>
<h2>Icon</h2>
<input name="icon" type="text" value="<?php echo $icon ?>" size="50"><br><br>
<h2>Message</h2>
<textarea name="message" cols="80" rows="30"><?php echo $message ?></textarea>

<p>
<input name="submit" type="Submit" value="Submit">
<input type="reset">
</p>
</form>

<?php

{
$id = $_POST['id'];
$title = $_POST['title'];
$date = $_POST['date'];
$user = $_POST['user'];
$icon = $_POST['icon'];
$message = $_POST['message'];

$query = "UPDATE tutorials SET name = '".$id."', keywords = '".$title."', avatar = '".$date."', category = '".$user."', skill = '".$icon."', brief = '".$message."' WHERE id = '".$id."'";
$result = mysql_query($query)or die(mysql_error());
echo 'News item successfully edited.';
}


mysql_close($connection);
?>


ps. nice script :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users