Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:41:06+00:00 2026-05-22T19:41:06+00:00

I have the button working, when I click the X button on my status

  • 0

I have the button working, when I click the X button on my status it takes me to delete.php shows me the link in the browser and the streamitem_id number like so.

Here is the button

echo '<a href="mysiteraw/sn-extend/theme/default/delete.php?='.$streamitem_data['streamitem_id'].'" onclick="show_confirm() alt="Delete" title="Delete" class="delete">X</a>&nbsp;&nbsp;&nbsp;&nbsp;';

And the link it gives out

my site
/raw/sn-extend/theme/default/delete.php?=1516

I then see on this page ‘cannot find comment’ So can anyone help me with the delete.php page please?

Here is my SQL

CREATE TABLE IF NOT EXISTS
on_streamdata ( streamitem_id
int(11) NOT NULL auto_increment,
streamitem_type_id int(11) NOT NULL,
streamitem_creator int(11) NOT NULL,
streamitem_target int(11) NOT NULL,
streamitem_timestamp datetime NOT
NULL, streamitem_content
varchar(5000) NOT NULL,
streamitem_public int(11) NOT NULL,
streamitem_interactionallowed
int(11) NOT NULL default ‘1’,
streamitem_isgroupie int(11) NOT
NULL default ‘1’, streamitem_viaid
int(11) NOT NULL default ‘0’,
PRIMARY KEY (streamitem_id) )
ENGINE=MyISAM DEFAULT CHARSET=latin1
AUTO_INCREMENT=1953 ;

And here is my delete.php which is probably completely wrong as I’m new to PHP/MySql..Sorry

<?php
error_reporting (E_ALL ^ E_NOTICE);

$id=$_GET['id'];
$ipuser=getenv('REMOTE_ADDR');

//Connect to server and select databse.
mysql_connect("localhost", "", "")or die("cannot connect to server"); 
mysql_select_db("")or die("cannot select DB");;
$querycheck="SELECT streamitem_id FROM on_streamdata WHERE streamitem_id='$id'";
$resultcheck=mysql_query($querycheck);
$num=mysql_numrows($resultcheck);
if ($num==0) {
?>
<br>Comment not found.<br>
<br><br>
<a href="javascript: history.go(-1)">Back</a><br>
<?
} else {
$ip=mysql_result($resultcheck,0,"streamitem_id");
if ($ip==$ipuser) {

?>
<form method="post">
<p align="center">
Are you sure you want to delete this comment?
<input type="hidden" name="confirm" value="1">
<br>
<input type="Submit" value="Delete">
</form>
<?
$confirm=$_POST['confirm'];

if ($confirm==1) {


$query=" DELETE streamitem_id FROM on_streamdata WHERE streamitem_id='$id'";
mysql_query($query);
echo "<br>Comment Deleted.<br>";

?>
<br><br>
<a href="javascript: history.go(-2)">Back</a><br>
<?
} else {

?>
<br><br>
<a href="javascript: history.go(-1)">Back</a><br>
<?
}

} else {
?>
<br>You are not allowed to delete this comment.<br>
<br><br>
<a href="javascript: history.go(-1)">Back</a><br>
<?
}
}
mysql_close();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:41:07+00:00Added an answer on May 22, 2026 at 7:41 pm

    Ok, first you don’t pass any variable via the url query string here

    echo '<a href="mysiteraw/sn-extend/theme/default/delete.php?PUT_SOME_NAME_HERE='.$streamitem_data['streamitem_id'].'" onclick="show_confirm() alt="Delete" title="Delete" class="delete">X</a>&nbsp;&nbsp;&nbsp;&nbsp;';
    

    Hint: on next page you search for $_GET['id'], so I presume you should put id instead of PUT_SOME_NAME_HERE in above example 🙂

    Try that and share results.

    In your code example, there is also missing database selection and passing of mysql user/password. Do you remove them in purpose just to not show sensitive information here?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Silverlight Polling control. My goal is to have a Button
I have one issue with UInavigationcontroller In my firstview i have button.If i click
I have a button that I would like to disable when the form submits
In this example (which is working) on click of a button the section is
I have a button named okbutton. A callback function is bind to the click
I have button, which fires an event, that deletes a record from the database.
I have one issue with Datetime Picker In my firstview i have button.If i
I have a button on an ASP.NET wep application form and when clicked goes
I have a button on an ASP.Net page that will call Response.Redirect back to
I have a button inside an updatepanel. I have a PopupControlExtender linked to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.