RE: [PHP] how would I do this?
-Original Message- From: David McGlone [mailto:da...@dmcentral.net] Sent: Monday, December 27, 2010 1:14 PM To: PHP Subject: [PHP] how would I do this? Hi all, I am trying to make the link in this code not show the underscore and I can't figure out how I could do it. I've tried various different things I thought would work. I've tried things like lawn_maintenance= lawn maintenance, I tried concatinating lawn . maintenance and various other things. The examples above both produce just the word lawn here's the code I have so far: $services = array(lawn_maintenance, core_areation, over_seeding, hedge_trimming, mulch_installation, natural_debris_removal, leaf_cleanup_removal, snow_plowing); $services = array('Lawn Maintenance', 'Core Areation', 'Over Seeding', 'Hedge Trimming', 'Mulch Installation', 'Natural Debris Removal', 'Leaf Cleanup Removal', 'Snow Plowing'); echo 'ul'; foreach ($services as $service){ // echo ulliraquo; a href=index.php?page=$service$service/a/li/ul; echo 'lia href=index.php?page='.str_replace(' ', '_', strtolower($service)).''.$service.'/a/li'; } echo '/ul'; Happy holidays, new year, coding, Tommy Could anyone give me a hand? Obviously I don't understand arrays very well :-/ -- Blessings David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how would I do this?
Hi all, I am trying to make the link in this code not show the underscore and I can't figure out how I could do it. I've tried various different things I thought would work. I've tried things like lawn_maintenance= lawn maintenance, I tried concatinating lawn . maintenance and various other things. The examples above both produce just the word lawn here's the code I have so far: $services = array(lawn_maintenance, core_areation, over_seeding, hedge_trimming, mulch_installation, natural_debris_removal, leaf_cleanup_removal, snow_plowing); foreach ($services as $service){ echo ulliraquo; a href=index.php?page=$service$service/a/li/ul; } Could anyone give me a hand? Obviously I don't understand arrays very well :-/ -- Blessings David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how would I do this?
On Mon, Dec 27, 2010 at 2:13 PM, David McGlone da...@dmcentral.net wrote: Hi all, I am trying to make the link in this code not show the underscore and I can't figure out how I could do it. I've tried various different things I thought would work. I've tried things like lawn_maintenance= lawn maintenance, I tried concatinating lawn . maintenance and various other things. The examples above both produce just the word lawn here's the code I have so far: $services = array(lawn_maintenance, core_areation, over_seeding, hedge_trimming, mulch_installation, natural_debris_removal, leaf_cleanup_removal, snow_plowing); foreach ($services as $service){ echo ulliraquo; a href=index.php?page=$service$service/a/li/ul; } just clean up the array definition: $services = array('lawn_maintenance', 'core_areation', 'over_seeding', 'hedge_trimming', 'mulch_installation', 'natural_debris_removal', 'leaf_cleanup_removal', 'snow_plowing'); Could anyone give me a hand? Obviously I don't understand arrays very well :-/ looks more like it's the strings you're struggling with ;) -nathan
Re: [PHP] how would I do this?
On Monday, December 27, 2010 04:28:12 pm Nathan Nobbe wrote: On Mon, Dec 27, 2010 at 2:13 PM, David McGlone da...@dmcentral.net wrote: Hi all, I am trying to make the link in this code not show the underscore and I can't figure out how I could do it. I've tried various different things I thought would work. I've tried things like lawn_maintenance= lawn maintenance, I tried concatinating lawn . maintenance and various other things. The examples above both produce just the word lawn here's the code I have so far: $services = array(lawn_maintenance, core_areation, over_seeding, hedge_trimming, mulch_installation, natural_debris_removal, leaf_cleanup_removal, snow_plowing); foreach ($services as $service){ echo ulliraquo; a href=index.php?page=$service$service/a/li/ul; } just clean up the array definition: $services = array('lawn_maintenance', 'core_areation', 'over_seeding', 'hedge_trimming', 'mulch_installation', 'natural_debris_removal', 'leaf_cleanup_removal', 'snow_plowing'); Could anyone give me a hand? Obviously I don't understand arrays very well :-/ looks more like it's the strings you're struggling with ;) probably is. :) Ok I put quotes around each array, but I was still getting the underscore in the echo of the URL. What I was trying to do was to remove the underscore in the echo Only, but keep it in the URL, well that seemed like too much to bite off at the moment, so what I did was removed the underscore in the array names and just named each page the first word of the array. here's what I had: $services = array('lawn_maintenance', 'core_areation', 'over_seeding', 'hedge_trimming', 'mulch_installation', 'natural_debris_removal', 'leaf_cleanup_removal', 'snow_plowing'); page names match array names (ie: lawn_maintenance, core_areation etc..) here is what I now have: $services = array('lawn maintenance', 'core areation', 'over seeding', 'hedge trimming', 'mulch installation', 'natural debris removal', 'leaf cleanup removal', 'snow plowing'); page names are only the first name of the array (ie: lawn, core, over, hedge, mulch, etc...) Does that make any sense? LOL probably doesn't and it wasn't what I was shooting for, but hey it works.. :) -- Blessings David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How would I do this?
Hi. I have a problem with my tab/lyric site, I need to create an artist page, where users can view all lyrics/tabs by a certain artist. Now because im likely to get guitar/drum/bass tabs / lyrics for the same song, I want to have a table with links as follows (e.g): Blink 182 - Whats my age again?GuitarBassDrumLyricsBuy at Amazon. DammitGuitarBassDrumLyrics Buy at Amazon. MnMs GuitarBassDrumLyrics Buy at Amazon. Now I know this would be simpler if I had them in different tables, but I have my reasons why I dont. Here is the setup of the table for storing tabs/lyrics.. CREATE TABLE `resources` ( `id` INT NOT NULL AUTO_INCREMENT, `type` TEXT NOT NULL, `title` VARCHAR(100) NOT NULL, `content` TEXT NOT NULL, `user_id` INT NOT NULL, `rating` INT DEFAULT '5' NOT NULL, `views` INT DEFAULT '0' NOT NULL, `date` TIMESTAMP NOT NULL, `artist_id` TEXT, `amazon` TEXT, INDEX (`id`), UNIQUE (`id`) ); I was thinking I could extract data and shove it into a temporary table, but that just creates other problems, I think. Anyone got any suggestions? Please? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how would i do this ?
Hi I need to fill a variable a value (writers name) with the data coming from 2 different tables depending on the choice from the previosu page (add a new article or edit an old one). Is their an easier way to do this as the sql is rather ugly that I am using later as itis not clean in its choice giving extra records. if (isset($writer)) //for a new story $n = get_writer_name($writer); elseif (isset($story)) // edit old article $s = get_story_record($story); later in page... print query_select(page, select p.code, p.description from pages p, writer_permissions w where p.code = w.page and w.writer = '$s[writer]' or w.writer = '$n[writer]', $s[page]);? ANdreww ta Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]