Page 2 of 3 FirstFirst 123 LastLast
Results 17 to 32 of 41

Thread: How can i delete database value using an html page in php?

  1. #17
    Funking Prink! Raz316's Avatar
    Join Date
    Jul 2003
    Location
    Deal, Kent, UK
    Posts
    2,978
    Thanks
    130
    Thanked
    62 times in 52 posts

    Re: How can i delete database value using an html page in php?

    Why are you doing these things via a session variable?

    Why are you getting the news ID from $_SESSION and not $_GET ?

    have you tried echoing out the SQL statements to see if variables are being set as expected?
    Last edited by Raz316; 10-04-2013 at 11:43 AM.

  2. #18
    Registered+
    Join Date
    Apr 2013
    Posts
    19
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: How can i delete database value using an html page in php?

    i think for a particular user to store their information session is more secure.thats y i am using session.
    i removed session and changed my code like below:

    <?php
    include('connection.php');
    if(isset($_GET['id']))
    {
    $id=$_GET['id'];
    $query1=mysql_query("delete from news where id='$id'");
    if($query1)
    {
    header('location:news_list.php');
    }
    }
    ?>

    bt still it is not working.

    wht is the problem.

  3. #19
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: How can i delete database value using an html page in php?

    Quote Originally Posted by devimohan1988 View Post
    i jst completed php course n g.tech.nw i gt a project.
    A php course by who?

    Is this a commercial project that will be public facing? (ie on the internet)
    throw new ArgumentException (String, String, Exception)

  4. #20
    Registered+
    Join Date
    Apr 2013
    Posts
    19
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: How can i delete database value using an html page in php?

    i am doing php course at g.tech.

    this is a website for 1 company.after finishing it will appear n internet.

  5. #21
    Editable... jimbouk's Avatar
    Join Date
    Aug 2005
    Location
    Bristol
    Posts
    3,071
    Thanks
    321
    Thanked
    278 times in 226 posts
    • jimbouk's system
      • Motherboard:
      • Asrock B450M-HDV R4.0
      • CPU:
      • AMD Ryzen 5 3600
      • Memory:
      • Corsair Vengeance LPX 16 GB (2 x 8 GB) DDR4 3200 MHz C16
      • Storage:
      • Sabrent Rocket Q 1TB NVMe PCIe M.2 2280
      • Graphics card(s):
      • Sapphire Pulse RX 580 8GB
      • PSU:
      • Seasonic Core Gold GC-650
      • Case:
      • Lian-Li PC-V1100 ATX
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • AOC CU34G2/BK 34" Widescreen
      • Internet:
      • EE FTC

    Re: How can i delete database value using an html page in php?

    Sorry but:
    Quote Originally Posted by devimohan1988 View Post
    i am doing php course at g.tech.
    I'm not sure we should be doing your homework for you, and
    Quote Originally Posted by devimohan1988 View Post
    this is a website for 1 company.after finishing it will appear n internet.
    please consider more appropriate training for a professional website.

  6. #22
    Funking Prink! Raz316's Avatar
    Join Date
    Jul 2003
    Location
    Deal, Kent, UK
    Posts
    2,978
    Thanks
    130
    Thanked
    62 times in 52 posts

    Re: How can i delete database value using an html page in php?

    So you've completed a course, and now you're making a website for someone? Or making this website as part of the course?

  7. #23
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: How can i delete database value using an html page in php?

    Quote Originally Posted by devimohan1988 View Post
    i am doing php course at g.tech.
    These guys?
    http://www.gteceducation.com/coursefinder.php

    Was trying to find a syllabus to see which methods they teach.
    throw new ArgumentException (String, String, Exception)

  8. #24
    Senior Member
    Join Date
    Dec 2012
    Location
    Oxfordshire
    Posts
    272
    Thanks
    3
    Thanked
    18 times in 17 posts
    • phil4's system
      • Motherboard:
      • Asus Sabertooth Z77
      • CPU:
      • Core i7-3770K @ 4.6Ghz
      • Memory:
      • 16Gb Corsair Dominator Platinum @ 1866Mhz
      • Storage:
      • OS: OCZ Vertex 4 256Gb, Data: 3Tb Seagate HDD, Cache: OCZ Agility 4 128Gb
      • Graphics card(s):
      • 2 x EVGA GTX 680 SC
      • PSU:
      • 750W Corsair Pro Series AX
      • Case:
      • Corsair Obsidian 650D Black
      • Operating System:
      • Windows 7 Ultimate 64Bit
      • Monitor(s):
      • 2 x Dell U2410 Ultrasharp
      • Internet:
      • Plusnet Fibre Unlimited 76/20

    Re: How can i delete database value using an html page in php?

    I so want to walk away from this, as you will be lethal if this ever gets on the Internet.

    So things suggested:
    1) commenting out a form will stop it working.
    2) putting the GET value into a session and then using it isn't secure. At all.
    3) for all that is sane and sensible stop straight away fixing it, and get some SQL injection protection as detailed.
    4) try as I am other have said, output the sql that's to be run, and try by hand.

    I would love to say that this will protect you but from what I've seen I've no faith you'll use it correctly.

    Oh and the SQL Injection certainly won't solve your problem.

  9. #25
    HEXUS.social member finlay666's Avatar
    Join Date
    Aug 2006
    Location
    Newcastle
    Posts
    8,546
    Thanks
    297
    Thanked
    894 times in 535 posts
    • finlay666's system
      • CPU:
      • 3570k
      • Memory:
      • 16gb
      • Graphics card(s):
      • 6950 2gb
      • Case:
      • Fractal R3
      • Operating System:
      • Windows 8
      • Monitor(s):
      • U2713HM and V222H
      • Internet:
      • cable

    Re: How can i delete database value using an html page in php?

    Quote Originally Posted by TheAnimus View Post
    These guys?
    http://www.gteceducation.com/coursefinder.php

    Was trying to find a syllabus to see which methods they teach.
    http://www.gteceducation.com/course_details.php?id=353

    It's a very detailed course
    H3XU5 Social FAQ
    Quote Originally Posted by tiggerai View Post
    I do like a bit of hot crumpet

  10. #26
    Registered+
    Join Date
    Apr 2013
    Posts
    19
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: How can i delete database value using an html page in php?

    Hello sir,

    i am a beginner in php.that's y am asking these silly doubts.

  11. #27
    Registered+
    Join Date
    Apr 2013
    Posts
    19
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: How can i delete database value using an html page in php?

    Quote Originally Posted by Raz316 View Post
    So you've completed a course, and now you're making a website for someone? Or making this website as part of the course?
    this project is the part of my course.

  12. #28
    Registered+
    Join Date
    Apr 2013
    Posts
    19
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: How can i delete database value using an html page in php?

    please help me to find out the error in my code?

  13. #29
    Funking Prink! Raz316's Avatar
    Join Date
    Jul 2003
    Location
    Deal, Kent, UK
    Posts
    2,978
    Thanks
    130
    Thanked
    62 times in 52 posts

    Re: How can i delete database value using an html page in php?

    Quote Originally Posted by devimohan1988 View Post
    please help me to find out the error in my code?
    In the nicest possible way (which isn't that nice I'm afraid) no, I will not help you.

    If this is part of your course, you've clearly not picked up enough knowledge during said course to be able to complete what is required. Helping you "fix" what you've made will not help you at all, it will not help you understand what you're doing.

    If you get little or no support from GTech, I suggest you do some of your own learning outside of the course first, try something like this - http://www.freewebmasterhelp.com/tutorials/phpmysql/

  14. #30
    Registered+
    Join Date
    Apr 2013
    Posts
    19
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: How can i delete database value using an html page in php?

    i removed comment of the form.
    <div align="center" style="width:50px; height:auto; float:left;border:solid 1px #DCDCDC;"><a href="news_delete.php?id=$id">delete</a></div>
    removed ?id=$id from a href.now the connection is moving to news_delete.php.bt cannt delete the value.

  15. #31
    Senior Member
    Join Date
    Dec 2012
    Location
    Oxfordshire
    Posts
    272
    Thanks
    3
    Thanked
    18 times in 17 posts
    • phil4's system
      • Motherboard:
      • Asus Sabertooth Z77
      • CPU:
      • Core i7-3770K @ 4.6Ghz
      • Memory:
      • 16Gb Corsair Dominator Platinum @ 1866Mhz
      • Storage:
      • OS: OCZ Vertex 4 256Gb, Data: 3Tb Seagate HDD, Cache: OCZ Agility 4 128Gb
      • Graphics card(s):
      • 2 x EVGA GTX 680 SC
      • PSU:
      • 750W Corsair Pro Series AX
      • Case:
      • Corsair Obsidian 650D Black
      • Operating System:
      • Windows 7 Ultimate 64Bit
      • Monitor(s):
      • 2 x Dell U2410 Ultrasharp
      • Internet:
      • Plusnet Fibre Unlimited 76/20

    Re: How can i delete database value using an html page in php?

    Please try item 4 in my reply above.

  16. #32
    Registered+
    Join Date
    Apr 2013
    Posts
    19
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: How can i delete database value using an html page in php?

    I executed the code in sql.it is deleting data from database.but still now it is not working with html form.

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •