Jump to content


Photo

MYSQL Deleting Help!


  • Please log in to reply
3 replies to this topic

#1 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 02 July 2006 - 12:25 PM

Hi guys.

I am basically wondering how i can do something with $_GET['blob']; var. Because I wanted to be able to use this:

page.php?del=post&id=ID.
But I don't know how to do it, Also When i try using more than one $_GET the code wont work.

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 July 2006 - 12:49 PM

play with the example i am providing to understand ok.



test.php the link ok.
<?php

echo"<a href='test_result.php?&cmd=delete'>try me</a>";

?>

test_result.php
<?php


if($_GET['cmd']==delete){

echo "delete database entry";

}else{

echo "no not there ok!";

}

?>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 02 July 2006 - 12:53 PM

What are you using? I form using the GET method, or a link?



1) If it's a form, the form should look like this:
<form action="action.php" method="GET">
<input type="text" name="field1">
<input type="text" name="something">
<input type="submit">

And the "action.php" will recieve the vars: $_GET['field1'] and $_GET['something']



2) If it's a link, the like should look like:
<a href="action.php?field1=value&something=somethingelse" ....>
And the "action.php" will recieve the vars: $_GET['field1'] and $_GET['something']



Orio.
Think you're smarty?

(Gone until 20 to November)

#4 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 02 July 2006 - 12:54 PM

I got it working eventually! Lol. thx =]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users