The display.php file runs a query that sorts the results based on the selection (sometimes multiple) made in the form. The display.php file looks something like this:
CODE
$selectsort = $_POST['selectsort'];
if( isset( $_POST['selectsort'] )) { $query = "SELECT * FROM contracts ORDER BY '{$_POST['selectsort']}' DESC";
}
$result = mysql_query($query);
I then echo the information in a table. I get results, but it doesn't pay attention to multiple selections. It only orders by the last selection made.
I can echo out the various selections and can see that the select part is working.
I am at the moment trying to program my own forum, but i need more then a single category, here is
my source: CODE function cat () { include("functions/functions.php");
echo '<table width="100%" border="0" cellspacing="0">
<tr> <td class="eb_top" colspan="3" style="border-bottom-width:
0; height: 30px; font-size: 12px;"> <b>Forum</b></td>
</tr>'; global $catid; $db = new db; $db->connec...
Hi all, this is my first function and as part of a script and i just want to know a couple of
things. here is the code for the function: CODE <? function
clean($dirty_string) { $muddy_string = stripslashes($dirty_string);
$murky_string = strip_tags($muddy_string); $clean_string =
htmlentities($murky_string); }; ?> So the first thing is how secure is
it? the script this will be used in connects to a database and sends an email so it needs to stop
SQL injections and any email ab...
Php + Mysql Question!
- While inserting data into MySQL, how can I know if the data I'm in (4)
Basically, I want to know if the Data I'm inserting through a Form is already there or not. Sort
of a Username registration page. I have this, but it doesn't appear to work... CODE
$result = mysql_query("SELECT * FROM users WHERE
username='$username'"); if($result == 1) { echo
'<h1>ERROR!</h1>The username you have chosen already exists!'; } ...
I've been reading through my old php book (PHP 4.1) and came across this data validation class.
It can check a number of things ranging from telephone numbers , credit card number formats, email
address and some others. I checked out some of the methods although I didnt expect it to work 100%
because I've found source code errors thoughout the book and CD. I tested out a few of the
methods to check and some of them did return expected results but some didnt either so the data
validation class was not perfect and it didnt really bother me. The cool thing I found...
Ok i can't believe I need help in php but I can't figure this out... If i have an array,
lets say called test, how do i get a certain value from that array when referencing it dynamically
by either a string or another variable? Example: CODE $test=array(1,2,5);
$name="test"; //Doesn't work: echo $$name[0]; /Doesn't
work: echo ${$name}[0]; ...
Hi everyone I was wondering if anyone could help. I want to create a page with multiple drop down
lists and depending what the user selects decides the page they will be taken to. Sorry i havent
explained this too well. Here is an example of what i want (link below) the user is also emailed a
copy http://www.dermalogica.com/SpeedMappingOnl...US®ion=B I have searched the web and come
close but nothing does it right I would be extremely greatful if anyone could help! Thanks ...
I need help on a join, I think I have it mostly done, but I know my syntax isn't right. First
off, to give you an idea, I have two tables, plus my session variables. I'm first selecting from
the table: user_resources where the user_id = that of the $_SESSION's, and in
user_resources, there are three fields, user_id, resource_id, and amount, and I wish to print all of
this. But the hitch to it is, resource_id is an integer. In another table called resources, are the
fields id and name. The resource_id = resources.id, and I want to print the name associat...
Some user posted a similar problem i had when i tried to figure out how to update content on my
website in less work as possible. This is just part of the "big" plan i have for my site but it can
be helpfull to you guys if you like FlatFile. I hope that mod's don't mind me posting the
same code here and on their forums, couse if they do i'll delete it from their forums
/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> So
here's the situation. Let's say you have a folder called 'myfilesdirectory' on your
s...
The thing that has been bugging me for a while was that switch statement that we use to create ID
browsing (some use If-Ifelse but results are the same for both). I wanted to figure out a way to use
more dynamic switch statement so that i only need to update my links array in order to create links
for template. With use of foreach, array_keys, and in_array functions finally i managed to do so.
Also i'm planing on changing foreach with array_walk but i'll do that later. Now for the
code.. First we create an associative array something like this CODE $gl...
I'm correcting a 'few' php-files for a friend, but I got this line of code: CODE
$ban = ($data->login) ? $lban : $iban; and I don't know
what it does xD Could someone please explain me what this line does? Thanks...
I have a MySQL database which stores articles. A sample article would look like this: CODE This
is a body. This is a body.This is a body.This is a body.This is a body.This is a body.This is a
body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This
is a body.This is a body.This is a body.This is a body. This is a body.This is a body.This is a
body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This
is a body.This is a body.This is a body.This is a body.This is a body. That'...
suppose i have a page, page.php?part=1 there i have some text fields. user will give input, but
after taking input, it will not put the data in mysql .. but it will take to the next step..
page.php?part=2 (if any field is left blank, it will not go to next page.. ) . and there also some
fields.. after the user has filled that form also, then it will insert all data (from part1 and
part 2) in mysql. i want to ask, how i can collect data from 2 pages and put in mysql at once....
Hey i have a little problem with my php script. i dont really know how to make it work ^^; I want to
have this exact table: ' I made mysql table that has one column for id(auto-increment,
primary key), and then it has row and collumn and text. row means which row in the html table and
collumn wich collum. (obviously /tongue.gif" style="vertical-align:middle" emoid=":P" border="0"
alt="tongue.gif" />) here is the mysql table screenshoted from phpMyAdmin: r means row and c
collumn /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue...
I got this excercise from school, im trying to understand it but im unable..can someone help me ?its
very small problem but im not getting the point. ------------------ Create a string:
$wholestring = “splitwholestring”; And split it to array using for loop. So that you have a
array containing all the letters of the string: array == s, array == p, etc. Display results.
(hint: strlen(), substr() - functions are useful) ------------------...
I want to install 4 scripts on my website .. 1- Gallery 2-Classfied Ads 3-Game Cheats Script (A
simple script where ppl can register and then submit the cheats) 4-Php Nuke The problem is that all
of 4 scripts needs registeration of members (use 4 different databases).... I want that all the
member which is registered at one place can login at all of the services..i mean , one registeration
form , that can work for all.. how i can do it ? Please tell in details..thanks....
Say I have a variable such as $nav_item and it had to contents Home . IE: CODE
$nav_item = 'Home'; How would I make so that $nav_item was an array and
had the following contents? CODE $nav_item = array ('h', 'o',
'm', 'e'); With the case changing (ie H would become h and U
would become u ) EDIT: Okay found out that I could change the case with
array_change_key_case ($nav_item, CASE_LOWER); ...
Okay so what Im trying to figure out is how I would go about giving the people to uh, well for
examplkes sake it would be like "how many cats do you have" then theyd fill in a number, submit and
the next page would print out boxes for as many cats they have that will be too fill in a color of
the cat, so basically something like that, where it will only give them so many fields based on how
many they said they have, and then their final "reciept" will only print out stuff for as many as
they filled itn ...
In the Head portion of an Html file, there are usually several Meta Tags that contain data about
various things, like the tag for keywords, an Author's name or maybe a description field. Here
are two example Meta tags: HTML meta name =" Keywords " content=" keyword1, keyword2 " />
meta name =" Description " content=" A Description of the file's content is here " /> So,
what I have a question about concerns checking a file to see what information is included in these
tags and using that information as variables or content in the output of the page...
Hello, it's been a while since i've been active in the PHP Board ( i used to be really
active in here ), not only to help others but also to request help ( people knowing those requests,
dont share your bad experience with my requests /tongue.gif' border='0'
style='vertical-align:middle' alt='tongue.gif' /> ) Anyway, i am requesting help on a listing of
members, i totally forgot about how to fetch the rows from a table and display each row, i thought
it was: CODE $result=mysql_query("SELECT * FROM $usertable ORDER BY id
DESC") or...
Have been trying to solve this for a long time now, so I thought I´d give you guys a chance to break
it! I want to remove an object from an array that I store in a Session object. I´ve written a
function that takes an array and an id as parameters. Checks if one of the objects has the id I want
to remove and then it´s supposed to remove it. Quite simple, that´s why I cant see why it doesnt
work! Here´s the code: CODE function Remove_prod($id2,$AL) {
print_r($AL); foreach ($AL as $prod) if($prod-...
I know how to send back the check-boxes, so that's not the issue. I have a form that contains a
group of 5 check-boxes. The user could select none, one, all, or any combination in between.
I'm working on form validation right now and am doing most of it server side. The validation is
set so that if the user has to go back all their data is retained. I'm using case statements,
which work wonderfully, but in this circumstance I don't know what would be the best method that
allows for a multitude of combinations. I think there is a possibility of somethi...
Hi, Does anyone know how i can do this, or scripts that will work on Trap17's servers and will
do the following: I have a .doc file form. Which i want to have filled in automactically, by HTML
Form and emailed to my address, with the data filled in. Any ideas? I have heard many differing
things, like XML, RTF, DOC, PDF... I have serched through many places and come up empty handed with
anything that works. /sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /> ...
Hi all, This sounds like a good place to ask this, I have a form Click Here to View that when
submitted will put the values into the PDF Here Is there a way in which to have the filled in
form both viewed to the user? and also have it emailed to me as an attachment. Any code or help
would be good... I get basics, but this stuff is hard to get to work and i can't get it to....
Php Classes
- Access the same class instance over multiple pages (1)
Hey everyone. I am having some trouble accessing the same php class instance in more that one page.
This is for my login script and what i need to do is be able to call the classes logout function
from a separate page. What i have tried to do is create a new .php page and include the class file
and then make a new class and call logout. This does not work because it does not log out the
current user which is my problem. Can anyone help me fix this or know of another way to do it?
Below is my class file CODE <?php // member class // handlers member logo...
Php Sessions
- Multiple users using the same login (2)
Hi, I'm realtively new to PHP and I'm considering creating some login functionality.
However I want a group of users to use the same loginname and password. They will be loggin infrom
different machines. The users will know they are sharing the account. Can anyone give me an idea
of what kind of effect this might have on my sessions? Will it create any odd hiccups or other
strange things?...
I have a form, from where the data is being posted to a php script. Now in the php script the script
has to forward the data to another script with posted data. I know this can be done using header but
i don't know how to keep the data posted with form in POST method. For example: The form
below: Code: Now its posting data using POST method to 1.php...and now 1.php will
redirect everything to another php script with the data and it should be in POST method ... How can
i do this ? Thanks. ...
i want to put a highscore section for a bunch of flash games on a website. i know that when most
games are done the score is in the post data, which can be viewed if you have the firefox live http
headers extension. but how would you insert the postdata from the flash games into the database?...
Looking for multiple, selection, array, table, order, data, multiple, selection, array, table, order, data
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for multiple, selection, array, table, order, data, multiple, selection, array, table, order, data
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE
forum, Create your own topics, Ask Questions, track topics, setup
subscriptions & notifications and Get a Free Website w/ Email and FTP.