[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 05-11-2007, 03:07 PM   #1 (permalink)
NamePros Member
 
Join Date: Aug 2006
Posts: 110
0.00 NP$ (Donate)

D14Posters is on a distinguished road


PHP Help (should be easy...)

Hi,

I wanted to see if someone could help me here. I don´t know php so the terminology might not be right... If this takes longer than I think I can paypal someone some money for their efforts.

I have a site with a database that has the celebrity names and when the names show up on the celebrity page (say Britney Spears page) they are called up using $name. I wanted to insert this code: <a href="http://ads.auctionads.com/pagead/link_59da060bb6f873222888_e4b8fa4b28026552eb3a825d 88b4fb36_http%3A//search.ebay.com/britney-spears_W0QQfromZR34">Buy Britney Spears Merchandise</a>

on the celebrity pages, where "britney spears" is substituted by the actual celebrity name for that page. How do I do it so that I can insert $name and have the celebrity name appear...

sorry for the confusing explanation

thanks
D14Posters is offline  
Old 05-11-2007, 03:16 PM   #2 (permalink)
JFS
NamePros Regular
 
JFS's Avatar
 
Join Date: Oct 2005
Location: Portugal
Posts: 760
56.85 NP$ (Donate)

JFS is just really niceJFS is just really niceJFS is just really niceJFS is just really niceJFS is just really niceJFS is just really nice


it's easy...
Code:
<?php

$ads = " 
<a href='http://ads.auctionads.com/pagead/link_59da060bb6f873222888_e4b8fa4b28026552eb3a825 d88b4fb36_http%3A//search.ebay.com/".$name1."-".$name2."_W0QQfromZR34'>Buy ".$name1." ".$name2." Merchandise</a> 
";

echo $ads;
?>
why the $name1 e $name2 ?
because you can't have a $name being "britney-spears" and "Britney Spears" at the same time.
$name1 would be "Britney"
$name2 would be "Spears"

this is the quickest way.
__________________
João Fernandes Silva
Selling :
19P.ORG - ARCADEHITS.ORG - AZIAN.NET - COREFANS.COM - CTUTORIALS.NET - DEDISEEK.COM - HITCHECK.COM - HOST15.COM - HOSTCUSTOMER.COM - LARGETIPS.COM - SCRIPTCANDY.COM - VISUALBOOK.NET - VOXVPS.COM / .NET - WALLPAPERSARENA.COM
JFS is offline  
Old 05-11-2007, 03:27 PM   #3 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,546
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
PHP Code:
<?php

$ads
= "<a href=\"http://ads.auctionads.com/pagead/link_59da060bb6f873222888_e4b8fa4b28026552eb3a825 d88b4fb36_http%3A//search.ebay.com/$name1-{$name2}_W0QQfromZR34\}>Buy " . ucfirst($name1) . " " . ucfirst($name2) . " Merchandise</a>";

echo
$ads;

?>
__________________
Eric is offline  
Old 05-11-2007, 03:49 PM   #4 (permalink)
NamePros Member
 
Join Date: Aug 2006
Posts: 110
0.00 NP$ (Donate)

D14Posters is on a distinguished road


Thanks for the two very quick replies!

BUT, the database is already there and the one name "britney spears" or "Cristiano ronaldo" are already on the database and are one string ($name).

did what i just say make sense?
D14Posters is offline  
Old 05-11-2007, 04:04 PM   #5 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,546
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
then you could just..

PHP Code:
<?php

$ads
= '<a href="http://ads.auctionads.com/pagead/link_59da060bb6f873222888_e4b8fa4b28026552eb3a825d88b4fb36_http%3A//search.ebay.com/' . str_replace(' ', '-', strtolower($name)) . '_W0QQfromZR34">Buy ' . ucwords($name) . ' Merchandise</a>';

echo
$ads;

?>
__________________
Eric is offline  
Old 05-11-2007, 04:05 PM   #6 (permalink)
JFS
NamePros Regular
 
JFS's Avatar
 
Join Date: Oct 2005
Location: Portugal
Posts: 760
56.85 NP$ (Donate)

JFS is just really niceJFS is just really niceJFS is just really niceJFS is just really niceJFS is just really niceJFS is just really nice


yes.

then something like this should work
Code:
<?php 

$names = str_word_count($name,1);


$ads = "<a href=\"http://ads.auctionads.com/pagead/link_59da060bb6f873222888_e4b8fa4b28026552eb3a825 d88b4fb36_http%3A//search.ebay.com/$names['0']-{$names['1']}_W0QQfromZR34\}>Buy " . ucfirst($names['0']) . " " . ucfirst($names['1']) . " Merchandise</a>"; 

echo $ads; 

?>
__________________
João Fernandes Silva
Selling :
19P.ORG - ARCADEHITS.ORG - AZIAN.NET - COREFANS.COM - CTUTORIALS.NET - DEDISEEK.COM - HITCHECK.COM - HOST15.COM - HOSTCUSTOMER.COM - LARGETIPS.COM - SCRIPTCANDY.COM - VISUALBOOK.NET - VOXVPS.COM / .NET - WALLPAPERSARENA.COM
JFS is offline  
Old 05-11-2007, 06:31 PM   #7 (permalink)
NamePros Member
 
Join Date: Aug 2006
Posts: 110
0.00 NP$ (Donate)

D14Posters is on a distinguished road


Thank you very much for both of you!!!

SecondVersion, I have another "easy" request. I was going to PM you but since I think this might be of general interest for AuctionAds users I will ask for your help again.

Using the above information, how would I go about inserting the celebrity name on the following line of auctionads code:

auctionads_ad_kw = "britney spears";

Also, since I can use several keywords on this code separated by a ";" I would like to have a "default" keyword of "paris hilton"

Thanks again and let me know if I can paypal you something for your time!

Fernandes
D14Posters is offline  
Old 05-11-2007, 06:41 PM   #8 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,546
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
Quote:
Originally Posted by D14Posters
Thank you very much for both of you!!!

SecondVersion, I have another "easy" request. I was going to PM you but since I think this might be of general interest for AuctionAds users I will ask for your help again.

Using the above information, how would I go about inserting the celebrity name on the following line of auctionads code:

auctionads_ad_kw = "britney spears";

Also, since I can use several keywords on this code separated by a ";" I would like to have a "default" keyword of "paris hilton"

Thanks again and let me know if I can paypal you something for your time!

Fernandes
PHP Code:
<?php

// your db code here, pulling names.. possibly make an array of names
// then..
?>
auctionads_ad_kw = "paris hilton;<?php echo implode(';', $names); ?>";
or, if you meant you could have several 'auctionads_ad_kw'
PHP Code:
auctionads_ad_kw = "paris hilton";
<?php

// your db code here, pulling names.. while looping through names..
echo 'auctionads_ad_kw = "' . $name . '";' . "\n";

?>
And no $$ is necessary

But, if you feel like you must, you can donate @ www.domainportfolio.us
__________________

Last edited by SecondVersion; 05-11-2007 at 06:48 PM.
Eric is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 12:15 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85