Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Deleting Items From A List


When i click one of the delete buttons, the form submits, but nothing happens. I'm pretty sure i'm doing something stupid with the form buttons, but I've been staring at it too long...any takers? Code:




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
A|B|C List Items
i have a problem trying to make a "list all" items page. So far i just have A-Z items, but for 0-9# items, i just cant make them show. Code:

View Replies !   View Related
Evenly List X Items
I have a mysql database in which there are x rows. I would like to evenly list these items on 3 columns. Since I don't know how many items I'll have,is there some formulas on how to come up with the number of HTML rows required to display the items evenly?

Here's the structure of my HTML table.

<table>
<tr>
<td>x1 <br /> x2 <br /> x3 <br /> x4</td>
<td>x5 <br /> x6 <br /> x7 <br /> x8</td>
<td>blah blah blah</td>
</tr>
</table>

View Replies !   View Related
Randomizing Items On A List
I'm running a third party php script and am having trouble setting the order for a list. The list (see the attached image) is divided into 2, "cat_featured" and "started" at present they are both set to the same order, with the most recent appearing at the top of the list. What I am trying to do is sort it so that the cat_featured items are sorted randomly and the "started" items are left the same (sorted by most recent first). Here is all the necessary code I think:

function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "cat_featured desc, started desc";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_title" => array("cat_featured desc, title", ""),
"Sorter_started" => array("cat_featured desc, started", ""),
"Sorter_asking_price" => array("cat_featured desc, asking_price", ""),
"Sorter_location" => array("cat_featured desc, state_province " . $SorterDirection . ", city_town", "")));

View Replies !   View Related
Dynamic List Items
I’m trying to build a multi-level unordered list from a database query. I can't figure out a good way to do this. How can I create this: Code:

View Replies !   View Related
Adding Items To A List Or Menu
Not sure if it is a php question but since i am working in php here it is.

Ho can i add items to (the item label=visual text and the value=index
number) a list object on a website.

I am having a list with 4 items and i would like to add the text from a
textfield (textfield1.value) to the list object so it will hold 5 items.

View Replies !   View Related
Dynamic List Items Repeating Themselves
I'm working on this online magazine, and each page (well, other than the front page) has a menu included on the right-hand side consisting of articles divided into three sections: articles, columns, reviews. For some reason, whenever I click on one of these article links, that link takes the place of the first link in the section. You can see what I mean here: PHP for the included right_menu.php PHP Code:

View Replies !   View Related
Adding List Items To A Database
Not sure if this is javascript or php so i put it in both newsgroups, sorry
if it's the wrong group.

I wrote (with help) a code to put several items in a list object (select)
and I would like to add the items in this list to a database.

I know how to add a selected item to the database but how can i put al the
items tot the database. I need somekind of loop wich go's through the list.

View Replies !   View Related
How To Set Priority Among A List Of Items In A Category Using UP And DOWN Button?
I have a list of items in a category stored in a MySql table. I would like to set priority among the list of items so that I can move a particular item UP and DOWN (one row UP or one row down at a given time) using a button.

View Replies !   View Related
Grabbing A Random List Of Items, One Per Line?
I want to do though is search these lines of data, line by line, and grab a random word from each line, until a reach a limit. So far I have this, Code:

View Replies !   View Related
Separating List Items By "|"
i have a little problem, want to separate php list items by "|" so they can be distinguished one by one. which is displayed inline.

<li><h2><?php _e('ÍÇá&#1740;À'); ?> <?php _e('ÊÍÇÑ&#1740;Ñ'); ?></h2>
<ul>
<?php wp_get_archives('type=postbypost&limit=7'); ?>
</ul>
</li>

View Replies !   View Related
Deleting A File From Server Through A File List
I've been having trouble with this for a while. Ages ago I made an upload script that lets you upload to files/upload/ and then once you upload it, a piece of PHP will show the files in that folder.

In the admin section of my page i'm trying to find a way to delete the files off the server without having to dig into the FTP and do it manually.
Are you able to do that with PHP? Code:

View Replies !   View Related
Show Two Items In A Row When Items Are Picked Randomly?
I've looked at this inside and out to figure out how do a random twice so that it has a much less likely chance to show the same item twice in a row. But rand(1,3) doesn't seems to let you put variables in them $, only numbers.

how to make this a lot less likely to show two items in a row when items are picked randomly? I even tried this below, and if two numbers are the same then it shows the higher numbers, but if they are not the same then they show one of the first calls for the random items.

Thing is, if they are not the same and it shows the first calls for a random number, its back to the same problem again of showing too many same items again. Anyone know of some easier and more effective ways of doing this? Code:

View Replies !   View Related
Adding Items And Sub Items Using The Following Screen
how to add root items and sub items in the following page using a database. Code:

View Replies !   View Related
Batch File Deleting And Folder Deleting
I have a folder in my web site where I used php to create and copy in files. but now I can't delete them easily. The only way I know how that is possible is through php. I get an error the following ftp error:

550 th: Permission denied
I had the chmod() set to 0777 on every file and folder. But I still seem to loss control over the files when I try and do things with them through other means.

I think it is because the user I use to access the files via ftp a diffrent user. So I tryed to add a function with chown() for the new files I was posting and uploading. It didn't work on those new files. so it looks like the only thing I can do is use the unlink() function which deletes the files fine.

The only problem is now I have something like 100 sub directories all with files in them. I need to figure out a way to batch delete them. I can't find a script that goes through and finds all file contents including all sub directories and unlink those things.

I found some that will use a for loop to list out the contents of a folder but it is just files. No sub directories. Any body got any ideas on which functions I should use or know where a script is that I can base mine off of.

I am not sure how to approach this since what I tryed with chown and chmod has failed thus far. I currently have no code and am starting from scratch on this batch flushing of my directory.

View Replies !   View Related
List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that:

- reads in all the files in a particular directory
- displays the file names in a html list and makes a link of them:
<ul>
<li><a href="filelocation1">filename 1</li>
<li><a href="filelocation2">filename 1</li>
<li><a href="filelocation3">filename 1</li>
</ul>

etc.?

So basically it creates a list of links with the contents in that directory,
so you can download them from there.

View Replies !   View Related
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not.

What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings.

SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = &#391;') ORDER BY msgno DESC LIMIT 100

What I'm getting, though is a list that looks like this:

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1

I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary.

If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1.

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 2214 msgno: 0412141622 msglist: 1
mbxno: 2189 msgno: 0412141408 msglist: 1
mbxno: 0000 msgno: 0412141213 msglist: 1
mbxno: 0003 msgno: 0412141213 msglist: 1
mbxno: 2265 msgno: 0412132029 msglist: 1
mbxno: 0000 msgno: 0412131950 msglist: 1

How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?

View Replies !   View Related
Produce A List Of Tables Currently Within My Database And List Them In A Drop Down Box.
I need to produce a list of tables currently within my database and list them in a drop down box.

View Replies !   View Related
Populating A List Box Or A Dropdown List Using Php And Odbc
I need to populate a list box and/or a dropdown list on a form. I have all
the bits and pieces together, all bar the code which takes the result of a
query and creates a list box.

View Replies !   View Related
Mailing List Manager, Send To List
I'm looking for a mailing list script (php) that has a function to let
users to reach out to all recipient on the list by simple send the
email to a specific maillist- address.

Mailman has this functionn but as a just got a webserver account I
can't use mailman nor install it.

View Replies !   View Related
Related Items
I noticed a lot of websites show "Related Items" on each product page. I want to know how usually do you implement it. Should I add a field in the mysql table to hold the "Related Items" information? What's the best solution?

View Replies !   View Related
Get ID Of Deleted Items
I wonder if there is anything similar to "mysql_insert_id();"
for deleted/updated id's?

If i do a query and DELETE WHERE text_field="",
can i get the id's of the fields that were deleted?

View Replies !   View Related
How Many Items Are In An Array?
I dont know how many values there are in my array after it's been split.. is there a command? array_count_values doesnt do what I need sadly.

View Replies !   View Related
Favorit Items
i have many tables with different data structure due, am  making a service which will allow users to add itimes to thier "favorit items" tables
I thinked to use the table names as a hidden filed, like if the table name is "hotel" and the user added a hotel to his favorit items , the hidden fild will be hotels, and then pass that field as a variable then use it in a query to get the hitel data, does this adea work? or there is a better way ?

View Replies !   View Related
Using If Empty With Two Items
I am trying to say if $_Post and $_Session are empty set the variable $dcparent to equal 1, but it doesn't like what I am doing. 

if(isset($_POST['dcparent'])) {
$dcparent = mysql_real_escape_string($_POST['dcparent']);
}

if(isset($_SESSION['dcparent'])) {
$dcparent = mysql_real_escape_string($_SESSION['dcparent']);
}

if(empty($_POST['dcparent']) && (empty($_SESSION['dcparent'])) {
$dcparent = 1;
}

View Replies !   View Related
Same Items Of Data
Im fairly new to php and am wishing to grab information from an sql database, then sow this informations in a png image. Also I was wondering for example if I always grabbed the same items of data from mydb.

Could I call the .png via this method for example 122.png would show the relevant info for person 122 and 88.png would show the info pertaining to person 88. The blank png would be the same every time but the data diplayed by it would change bassed on the number preceding the .png file extention. Im unsure if this is possible however if anyone knows.

View Replies !   View Related
Selecting Only Certain Items
I am making a review site for a friend, its a movie review website, im using php and mysql (phpmyadmin) and I ran into a problem. I am able to submit, edit, and display reviews, but I have a menu system i want to work but cant figure out how to make it work.

The menu system is composed of the letters A-Z and then # for numbers. Each letter is a different button linking to all the reviews starting with that letter. I need to be able to have the user click the letter of choice and then have php read the mysql database and only output tho's movies that start with that first letter or number. I cant find an answer Ive searched and searched and have only found full word matchings.

View Replies !   View Related
Latest 9 Items
I'm going to create a table in my database called 'latest_items'

which should store the latest 9 items (which my users upload etc)

but how would i display the latest 9 items. and what if the table already contains 9 records.. and a user uploads a new item, how would i change the table.

View Replies !   View Related
Checked Items
I was wondering what would be the best way to create a list of items from another list that's generated by PHP. For example, list1 has 20 items, I check say 5 of them and I only want those 5 to show up on a new list. list1 is generated from a mysql database. I want list2 to only show the 5 I checked from list1, any idea how to do this? So, for page1: PHP Code:

echo "<form action=create.php method=post>";
$ex1 = mysql_query("SELECT * FROM database WHERE 1");
while($ex2 = mysql_fetch_array($ex1)) {
echo "<input type=checkbox name=t1> Example<br>";
}
echo "<input type=submit value=Submit></form>";

and I would want only the items I checked to show up on page2.

View Replies !   View Related
Calling Items
Is there a command to get results from a database that would display x amount of items, except the most recent? For example, let's say I have 5 items in my database. Item 1 is the oldest, 5 is the newest. I want a certain area of my page to display items 4, 3, 2, and 1. Item 5 (the most recent one) is to go to another area of the page. As I input a new item (6, let's say), item 5 would join the other four.

If there is no way of doing that, here is my back-up plan I would hope you would be able to answer: I want the most recent item (item 5) to display more than just the title of the newsitem. The older ones (4, 3, 2, and 1) to display only the titles, so the visitors would click on the titles to read the article.

View Replies !   View Related
Lots Of Items
i have a database with lots of items in it these items vary from things people will be able to "equip" to things that could "eat". Now what i want to do is make it so the items will be echoed only once if they have more than 0 of them. for example they have more than 0 Swords it would echo the image once but underneath it would have the actual ammount they have.

Now since i am going to have 100's maybe 1000's of items in game it would be a real pain to write out a search code for each item and then have an if statement to see if it is > than 0. I was wondering if anyone could advise on a quicker more efficient way of doing this.

View Replies !   View Related
Calculation Of Items
I was just wondering what method is best to use to calculate items from a drop down menu. I have two lots of drop down menu of which i want to send to a page to clarification before being submitted.

View Replies !   View Related
Collapsable Items
If you click on the items on this site the descriptions appear without refreshing the page.

Site with collapsable items.

View Replies !   View Related
Select First N Items
I have a large array I need to use to generate a form's checkboxes. Each row must have no more than 5 checkboxes, but the array has 32 items. I know how to perform a FOREACH extraction to get ALL of the items in an array, but how do i extract 5 at a time.

View Replies !   View Related
Top Items In Mysql
I have a database I store stats in for views.. but I am not sure how to find the top 5 or so viewed items. Here is the table structure:

CREATE TABLE `item_views` (
`id` int(8) NOT NULL auto_increment,
`myid` int(8) NOT NULL,
`ip` varchar(14) NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `item_id` (`myid`,`ip`)
)

It has quite a few rows for each `myid`. Did I set this up wrong to ge the top items? I'm guessing I need to group the `myid`'s but I would like to know the proper or most efficient way to store stats, since i need the top items frequently.

View Replies !   View Related
Multiple Cart Items
I've created a shopping cart application using php 4.06 and postgres. a problem i had was that when i added the same item twice it was adding an extra item as opposed to adding the quantities together. i did manage to sort this out to an extent but my only solution means using a block of code for each item which has made my script very long and i'm pretty sure has made the script somewhat unreliable. I would appreciate it greatly if someone could offer a solution to this, this is my code for adding items to the cart: PHP Code:

View Replies !   View Related
Getting The Items Into A Session Array
I'm creating a shopping cart and are having trouble getting the items into a session array. Lets say i have a form like: Code:

View Replies !   View Related
Finding @ In A String, And Other Items
Ok - I want to check a string for @ in it (Im checking to see if a string
that should contain an email holds a @ )

How would I go about this? preg_match? ereg? strstr? Examples?

Also - how would I find any non alpha numeric characters in a string so I
can give the user an error message. I dont want any characters besides
alpha-numeric in the strings.

View Replies !   View Related
Multiple Items Of Same Name In Session?
I have a shopping cart where I can add tshirt designs to the cart. The designs are added to a php session object called cart. The object 'cart' consists of the design name, color and the quantity.

The probem is that if someone adds the same design to the cart again then it just increments the quantity of the existing design with the same name instead of adding another instance of it to the cart. How can I have multiple instances of the same design with the same name in the cart at the same time.

One thing I thought of was to append some sort of incrementing id to the design name before it is added to the cart. Thus the next time the design is added it would have a new id appended and the resulting name would be different.

View Replies !   View Related
Preg_match - Pull Two Items From A Log
I'm trying to pull two items from a log with this layout:

[Fri Jan 10 06:02:38 2003] [51 Cavalier] Nasrim (Human) <Spirits of Fire> ZONE: nexus
[Fri Jan 10 06:02:38 2003] [56 Revenant] Kreelak (Dark Elf) <Spirits of Fire> ZONE: poknowledge

I'm trying to pull just the items in red to an array using preg_match_all(), but I can't seem to figure out the regex pattern to do it. If someone could help me out here I'd appreciate it.

View Replies !   View Related
Dynamic Form Items
I am trying to create A form that its fields will depend on a
form menu.
for example.
/***********************************************/
<form name="form1" method="post" action="">
<select name="select">
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
</select>

Text field 1<input type="text" name="textfield">
Text Field 2<input type="text" name="textfield2">
Text Field 3 <input type="text" name="textfield3">
Text Field 4 <input type="text" name="textfield4">

<input type="submit" name="Submit" value="Submit">
</form>
/***********************************************/
When the option 1 is selected only the textfields 1 and 2 to appear,
when option 2 is selected only textfields 1 and 3 to appear and so on... any
combination I would like.

I tried puting the textfields in "if" statments but i don't like it. its too
messy PHP and HTML code.
Any Ideas of how this could be done better ? If someone did something
similar before and has a relative link it would be good as well.

View Replies !   View Related
Number Of Items In A Cart
I am working with a session and a 'cart' (note that I do not really know what I am doing though).

I was wondering if there is some easy way (function) to work out how many items I have in my 'basket' / 'cart', because then I could
call this function from anywhere to show the user just how many items are on order



View Replies !   View Related
Only Allow X Number Of Items To Be Checked
I have a function that renders out tag categories, and then all the tags within said category. Each tag has a checbox beside it, i am wondering if it's possible to only allow a user to check 4 tags. Here is the function: Code:

View Replies !   View Related
Display Items Using Checkbox
i have a page where in it lists all job items on a table and each item has a checkbox
so when i check one or more items when i click the post button it should display the job items on this post page. my problem is, my post page is not working. Code:

View Replies !   View Related
Count Of How Many Items Are In Database
I am wanting to create an select menu for displaying the order of the item
on a page. I am guessing that I need to get the count of how many items are
in the db and them put them into a select menu.

Does anyone know how to do this or can point me in the right direction?

View Replies !   View Related
Display All Array Items
How do I display all the items within an array? Also, how do I delete a particular item from an array?

View Replies !   View Related
Changing Items After A Date
What I have is a table (code below) and it is for an events page. What I want is after the date has gone, it changes the whole row to grey. ( #666666 ). Code:

View Replies !   View Related
Get A Total Count Of All Items
I am having a looping issue, when i execute this code I get a total count of all items at the end of each echo.. Code:

View Replies !   View Related
Multiple Items In Foreach()
Can someone tell me what im doing wrong with the code bellow please? I get print_ticket called lots of times, with 1 as the hash,name,ticket_no responce.

(i have chequed that the query is returning the right results).

$return = pg_query($pg_connection, $query);
        $data   = pg_fetch_array($return);                   

foreach ( $data as $temp ) {
   
echo print_ticket ($temp['hash'],$temp['name'],$temp['ticket_no']);   
}

View Replies !   View Related
Compare Items In An Array...
I have been getting on fine with basic coding until I stumbled accross a problem. I cant seem to figure out how to check to see if a value in one array is in another array - and if so just simple report back "true" or "false".

Lets call the two arrays LOCKS and KEYS. Doing a print_r($locks) would give: Code:

View Replies !   View Related
Seperating Search Items
When conducting a php sql search i get some great results, however i want to expand my results so that when multiple search terms are added it will display all relevant fields.

$query = "SELECT * FROM Mixes WHERE dj LIKE '%$var%' OR event LIKE '%$var%' OR tracklist LIKE '%$var%' OR date LIKE '%$var%' ORDER BY event ASC";

From the above search i can only get single results from 1 field. I want to be able to seperate the search term into individual items that can be referrenced in the database.

So for example i search for a dj name and also an event they play at i get zero results, however if i search for them individually i get the results i want.

How do i expand the code to display the result of both the dj and the event or any of the other fields?

I presume that i need to be able to set each search item into an individual variable and then use them to search.

View Replies !   View Related
How Do I Delete Items From Array?
I can add several items to the basket, but how do I delete one from the basket? I want to delete any of the added items. Here is my code for creating the array and adding items to it.

// creating the array
$item = array();
$item['id'] = "1";
$item['price'] = "100";
$item['quantity'] = "1";

// add item
$_SESSION['basket'][] = $item;

View Replies !   View Related
Placing Items Into Cart
You have ordered one item and placed it into your cart. Let's say you ordered one small black t-shirt. Your cart will have the product_id, color_id and size_id for the small black t-shirt. The quantity of this item is, let's say 30. You have one in your cart, so how many are available:
1) 29
2) 30
Now let's say that while I ordered one small black t-shirt, Sven ordered 1 small black t-shirt, Anders ordered one black t-shirt, and Olov ordered one black t-shirt. If all four of us, at one time, are all ordering the same item and putting it into our carts, how many should there be available to us:
1) 26
2) 25
3) 29
4) 30
This is where the contention comes in. The client wants it done "FIFO" (First In First Out) meaning that whoever gets it first will subtract the quantity - but I dispute that (coming from somewhat of a Java background) that since PHP doesn't so single-threading, that means that all four of us could order t-shirts, but the quantity has to reflect that all four of us are ordering (multi-threading).

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved