Jump to content


?id=


15 replies to this topic

#1 romer

    Young Padawan

  • Members
  • Pip
  • 19 posts

Posted 19 April 2005 - 01:18 PM

i have been trying to figure out how ppl do
http://dark-hope.com/index.php?id=downloadfile&dlid=98
say i have index.php?id=downloads, how do i make it so the file will still use the id with another id like index.php?id=downloads?id=1.and i can figure it out cant someone help me? thx in advanced

#2 maansson

    Young Padawan

  • Members
  • Pip
  • 132 posts
  • Gender:Male
  • Location:Lund, Sweden
  • Interests:Hmm, not much for Photoshop. Havn't taking time to learn it yet. Use Fireworks to the graphical area. More into coding and stuff. PHP, CSS, Java and of course HTML.

Posted 21 April 2005 - 08:27 AM

Don't use id as name for your downloadfile-shit.
index.php?page=download&id=1
So you don't have to use "id" in all categories, or what I should call them (page in my case). Reply if you didn't understand.

#3 Annihilator

    Young Padawan

  • Members
  • Pip
  • 34 posts

Posted 21 April 2005 - 12:41 PM

maansson, on Apr 21 2005, 01:27 PM, said:

Don't use id as name for your downloadfile-shit.
index.php?page=download&id=1
So you don't have to use "id" in all categories, or what I should call them (page in my case). Reply if you didn't understand.
I've read it and I didn't understand can you explain more

#4 Blitz

    Jedi In Training

  • Twodded Staff
  • PipPip
  • 307 posts
  • Location:California
  • Interests:Php, html, css, etc, band, trumpet, anime, my dog, TV, computers, video games, sleeping, marching band, sleeping, jazz, sleeping, metal, sleeping, classic rock, sleeping, music, jazz band, did I mention sleeping?, kicking the hell out of kids that won't take the time to spell or use proper grammar, my website, etc.

Posted 21 April 2005 - 04:59 PM

Basically if you want to use more variables, just seperate them with an ampersand, or &.

So for you to that, index.php?id=downloads&did=5

To use that in your page, you could just use $id = $_GET[id]; $did = $_GET[did]; It gets the id in the url. You can't use the same thing in your url like index.php?id=1&id=2 because it's all used as $id in your page

#5 romer

    Young Padawan

  • Members
  • Pip
  • 19 posts

Posted 26 April 2005 - 08:42 PM

<style type="text/css">
<!--
body {
	background-color: #131516;
}
.style2 {
	font-family: Verdana;
	font-size: 9px;
	color: #000000;
}
-->
</style>

  <?php

include ("dbconnect.php");

if (isset($ID))
{
$tuts="SELECT * from sig where ID='$ID'";
$tuts2=mysql_query($tuts);
while ($tuts3=mysql_fetch_array($tuts2))

{

echo "
<font color=#000000 size=1 face=Verdana, Arial, Helvetica, sans-serif>$tuts3[message]<br>
<font color=#ffffff>$tuts3[description]"; }
}


else if(!isset($id))
{
$tut="SELECT * from sig ORDER BY ID ASC";
$tut2=mysql_query($tut);
while($tut3=mysql_fetch_array($tut2))

{

echo "<div align=center><table border=\"0\" cellspacing=\"1\" cellpadding=\"1\">
  <tr>
    <td><font color=#000000 size=1 face=Verdana, Arial, Helvetica, sans-serif>
<A HREF=\"javascript:void(0)\"onclick=\"window.open('view/sig/sigs.php?ID=$tut3[ID]','','height=172, width=400,scrollbars=no')\"><img src='$tut3[avatar]' border='0' alt='$tut3[title]'></a></td>
  </tr>
</table></div>
"; }
}?>

</div>
<title>view.php</title>

i need to add it to this but where,i dont get it i add it and get errors

#6 maansson

    Young Padawan

  • Members
  • Pip
  • 132 posts
  • Gender:Male
  • Location:Lund, Sweden
  • Interests:Hmm, not much for Photoshop. Havn't taking time to learn it yet. Use Fireworks to the graphical area. More into coding and stuff. PHP, CSS, Java and of course HTML.

Posted 27 April 2005 - 07:42 AM

Don't use if-statements. Use switch-case instead. If you don't know PHP, let someone else do it. It's not hard to make if you know PHP well, but I think you don't so... I really don't get what you wan't to do? Download a tutorial? Hmm...

Sincerily yours,
maansson

#7 romer

    Young Padawan

  • Members
  • Pip
  • 19 posts

Posted 27 April 2005 - 08:41 AM

im still learning :D

#8 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 27 April 2005 - 08:05 PM

Here is how I do mine:

<?php
if($page == index && $id == 1)
{
echo 'This is hello and id 1';
}
elseif($page == index){
echo 'This is just going to be hello';
}
elseif(!$page){
echo 'this is with nothing typed in';
}
?>

dEcade

#9 KniT

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 05 May 2005 - 02:47 AM

dEcade, on Apr 28 2005, 01:05 AM, said:

Here is how I do mine:

<?php
if($page == index && $id == 1)
{
echo 'This is hello and id 1';
}
elseif($page == index){
echo 'This is just going to be hello';
}
elseif(!$page){
echo 'this is with nothing typed in';
}
?>

dEcade
Hi, I used that PHP code there but when I put ?page=index&id=1 in the URL it still says "This is with nothing typed in" as though it's completely ignored the IF and first of the 2 ELSEIF statements. Do you know why this is? :D
Thanks in advance for any help.

#10 Hoot

    * Hooty Tooty Fruit *

  • Members
  • PipPipPipPip
  • 1,346 posts
  • Gender:Male
  • Location:Canada
  • Interests:Making Websites, Working in 3D, Playing the Drums

Posted 05 May 2005 - 08:35 AM

I do my code basicly the same way so try this it is from my site (text changed) its just the part you need:

<?php
if( !$page )
{
	echo"main page text.";
}
elseif( $page == index && $id == 1 )
{
	echo"main text for ?page=index&id=1";
}
else if( $page == index )
{
	echo"main text for the variables which will equil ?page=index";
}
?>

ok when you start off you can put an if statement on the first one because that will cary out that script first, but when you ad ?page=index&id=1 it needs else if so that if it shows its not the first statement it will move onto the next. The reason we have the $page == index && $id == 1 before $page == index is because the $page == index && $id == 1 statement has the same variables as $page == index so that if it wasn't before it would show the text you put in there and also the text thats in $page == index but this way it doesn't.

hope this helps :)

smardy

#11 KniT

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 05 May 2005 - 10:00 AM

Okay, I tried that too and it still didn't work... as though ?page=index etc. at the end of the URL isn't even there. :)

#12 Hoot

    * Hooty Tooty Fruit *

  • Members
  • PipPipPipPip
  • 1,346 posts
  • Gender:Male
  • Location:Canada
  • Interests:Making Websites, Working in 3D, Playing the Drums

Posted 05 May 2005 - 04:23 PM

you do know you manuly have to type that in?

#13 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 05 May 2005 - 05:35 PM

yes it won't just show up you have to add that part after .php

dEcade

#14 Neil

    Past Staff Member

  • Members
  • Pip
  • 149 posts
  • Gender:Male
  • Location:Australia

Posted 07 May 2005 - 06:50 AM

$downloadid = $_GET[downloadid];
SELECT * from DOWNLOADS where id='$downloadid'

#15 kraze

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 07 May 2005 - 07:23 AM

http://sectorfour.ne...orials.php?id=2 I just recently wrote a tutorial for this :P

#16 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 07 May 2005 - 04:46 PM

Here try this I used this one to show another guy, and I tested it so it should work:

<?php
if($page == index && $id == '1'){
echo 'this is if you put in ?page=index&id=1';
}
elseif($page == index){
echo 'This is if you put ?page=index';
}
elseif(!$page){
echo ' this is with nothing typed in';
}
?>

dEcade





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users