Jump to content

daft query issue


wmguk

Recommended Posts

hey, I keep getting a blank page,

 

<?
$order = $_GET['order'];
$order2 = $_GET['order'];

if $order = ""
{
    $order = "albumname ASC";
} else {
    $order = $_GET['order'];
}
?>

 

page url is show.php and i want it to look, if show.php isnt passing $order in the URL then set $order as albumname ASC, if it is showing $order in the url then display the whole page..

 

what am i missing?

Link to comment
Share on other sites

I just had a play, realising the code was rough, and this is what i now have,

 

<?
    $order == $_GET['order'];

if $order == ""
{
    $order == "albumname ASC";
} else {
    $order == $_GET['order'];
}
$order2 == $order ;
?>

 

but still totally white page,

Link to comment
Share on other sites

Um, what?

 

First off there is nothing in that code that would output anything to the page. Seconds, you changed the definitions to cmparisons as well (which shouldn't be). Third why would the code go through the logic to determine the value of $order, just to then define $order2 to be the same?

 

<?php

$order = (empty($_GET['order'])) ? "albumname ASC" : $_GET['order'] ;
echo $order;

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.