Jump to content

Show a certain quarry when page with form first loaded.


comparebest

Recommended Posts

Ok, just another noob problem here while working with PHP + MySQL:

 

I have a php page containing a form which I use to pull the data from mysql database. When the user chooses  a value/values from the dropdown lists and clicks submit, the page reloads and displaying the quarry results according to user's selection.

 

When user first loads the php page with form, it shows no data unless he clicks submit.

 

Question: How to show a default quarry value on first page load before user even get to use the form? In other words, I want the user to see the default quarry data pulled from DB on page load before he uses the form to refine the results...

 

I am not sure if its possible, but truly hope so :) I would appreciate any advice or pointer in the right direction.

 

Please let me know if you need the exact code I am using for my form page.

Link to comment
Share on other sites

Yeah is bunch of ways. See which works best for you.

 

if (!$_GET['value']) {
$value = "value";
}

if (!isset($_GET['value']) or $_GET['value'] == '') {
$value = "value";
}

if (empty($_GET['value'])) {
$value = "value";
}

if (empty($_SERVER["QUERY_STRING"])){
$value = "value";
}

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.