[advanced search]
NamePros Domain Auction
Live Event This Thursday at 6PM EDT - Prebidding open now
14 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Website Development
User Name
Password

Old 06-21-2008, 06:45 PM   · #1
stringerbell
New Member
 
stringerbell's Avatar
 
Location: Vancouver, BC
Trader Rating: (3)
Join Date: Aug 2006
Posts: 24
NP$: 0.00 (Donate)
stringerbell is an unknown quantity at this point
PHP Help! $$$

Hey Guys,

I need a little bit of PHP code, so I thought I'd come here and offer $7.77 (PayPal) to the first person that posts the required bit of code for me!

Here's the specs:

- PHP code (that could be pasted into a Wordpress PHP widget for instance).
- No calling data files if possible (the whole thing works inside the PHP code itself). Wouldn't want problems finding the right data-file in case I change directories/servers/websites or something.
- What it does: When the page loads, the PHP code goes out and creates a paragraph randomly out of different bits of data. For instance, say it goes and gets a radom item out of the data sets (greeting), (opening), (middle), (closing), (salutation), (signature). And, say you have 5 or 10 different greetings in the 'greeting' set, 5 or 10 different opening sentences in the 'opening' set, 5 or 10 different middle sentences in the 'middle' set, etc... So, you end up with a letter of what appears to be original content (in this case you have {5 to the power of 6} or {10 to the power of 6} different possible paragraphs as output). The output doesn't have to be formatted in any way, just a simple text paragraph is perfectly fine, and you don't have to fill anything in in the data sets (greeting 1, greeting 2, etc... or 1, 2, 3... is fine).

It should be pretty easy code to write, I just don't know enough about PHP to call random bits of data. So, as I mentioned, $7.77 for the first person to post proper, working PHP code!

Thanks!


Please register or log-in into NamePros to hide ads
__________________
DamnThe.com | Hot.Win.gs
stringerbell is offline   Reply With Quote
Old 06-21-2008, 09:02 PM   · #2
Tree
NamePros Regular
 
Tree's Avatar
 
Name: Trevor
Location: Atlanta, GA, USA
Trader Rating: (3)
Join Date: Feb 2006
Posts: 334
NP$: 0.00 (Donate)
Tree will become famous soon enoughTree will become famous soon enough
PHP Code:
<?php

$data
['greetings'] = array('Hello,','Look Who It Is!','Hey,','Hi,','Howdy,');
$data['openings'] = array('Opening 1','Opening 2','Opening 3','Opening 4','Opening 5');
$data['middles'] = array('Middle 1','Middle 2','Middle 3','Middle 4','Middle 5');
$data['closings'] = array('Closing 1','Closing 2','Closing 3','Closing 4','Closing 5');
$data['salutations'] = array('Salutation 1','Salutation 2','Salutation 3','Salutation 4','Salutation 5');
$data['signatures'] = array('Signature 1','Signature 2','Signature 3','Signature 4','Signature 5');
$letter = '';

foreach (
$data as $dataset) {
    
$letter .= $dataset[mt_rand(0,count($dataset)-1)] . ' ';
}
          
echo
$letter;

?>
__________________
NCIDev.com

Last edited by Tree : 06-21-2008 at 09:18 PM.
Tree is offline   Reply With Quote
Old 06-21-2008, 09:10 PM   · #3
stringerbell
New Member
 
stringerbell's Avatar
 
Location: Vancouver, BC
Trader Rating: (3)
Join Date: Aug 2006
Posts: 24
NP$: 0.00 (Donate)
stringerbell is an unknown quantity at this point
Thanks!

PP sent. Thread closed...
__________________
DamnThe.com | Hot.Win.gs
stringerbell is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
YUPPADS YUPPADS Traffic Down Under
Advertise your business at NamePros
All times are GMT -7. The time now is 04:34 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0