Buy Sell Discuss UK Domain Names at AcornDomains.co.uk Price Freeze on Business Hosting frm £4.95/month

Today's Drop Dates are: 19-02-2012 or 26-02-2012   All times are GMT. The time now is 01:40:30 PM.
Domain Name Sales Domain Software Calculate UK Domain Drop Dates Domain Registration NameDrive Domain Parking Subscribe to our Domains For Sale newsletter
Go Back   Domain Forum Acorn Domains Buy Sell Auction UK Domains > Website Design and Promotion > Website Design
Connect with Facebook

Website Design Discuss web design

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 27-10-2009, 03:25:20 PM     #1 (permalink)

 
SecNam's Avatar
 
Join Date: Jul 2004
Posts: 4,206
SecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond repute
Classified Rating: 100% (1)

page content query

im not sure if this is possible but....

is it possible to a certain keyword on a .php page that when is displayed pulls text from a file and inserts in onthe page.

also come to think of it, is this possible with an image also
hope that makes sence lol

Last edited by SecNam; 27-10-2009 at 03:43:01 PM.
SecNam is offline  
Old 27-10-2009, 04:05:55 PM     #2 (permalink)

 
Join Date: Jul 2009
Posts: 1,323
retired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond repute

Do you mean something like this?

<html><body>This is the text that is in the page but you want a <?php>$insert=file("input_file.txt"); echo $insert; ?> piece of text from the text file in the code to appear before this sentence and on any other pages to put the PHP code in?</body></html>

The above would pace the output of the file input_file.txt in any page it was used in, and if you change the file the text is changed on all pages that the php code is in. saying that there are lots of ways of doing the same thing.

Ty

Quote:
Originally Posted by paullas View Post
im not sure if this is possible but....

is it possible to a certain keyword on a .php page that when is displayed pulls text from a file and inserts in onthe page.

also come to think of it, is this possible with an image also
hope that makes sence lol
retired_member13 is offline  
Old 27-10-2009, 04:09:50 PM     #3 (permalink)

 
Nick's Avatar
 
Join Date: Apr 2008
Posts: 730
Nick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond repute

not sure - original question is bit vague:-

Code:
$original_text = "blah blah keyword1 blah";

$keywords = array('keyword1'=>'filename1.txt','keyword2'=>'filename2.txt');
foreach($keywords as $kw=>$file)
{
  $original_text = str_replace($kw,file_get_contents($file),$original_text);
}
Nick is offline  
Old 27-10-2009, 04:10:10 PM     #4 (permalink)

 
SecNam's Avatar
 
Join Date: Jul 2004
Posts: 4,206
SecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond repute
Classified Rating: 100% (1)

yes and no ty

as im more thinking about it i think it would be better if i can get it so it looks at the url then displays the text or .html/.php

so for example i have cars.co.uk (i wish) when someone visits that url the index page looks at url in question then as said above brings on the file associated with that url.
SecNam is offline  
Old 27-10-2009, 04:22:21 PM     #5 (permalink)

 
Join Date: Jul 2009
Posts: 1,323
retired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond reputeretired_member13 has a reputation beyond repute

This is one way of doing it.

Code:
code snippet removed
but you could make the site names into an array and then call the text up by doing a lookup, rather than writing out every site. That's the basics though. Obviously the part that looks up the domain could also be separated out to tidy up the code. I use a lot of this sort of stuff on my sites to allow single template use across multiple sites.

Last edited by retired_member13; 28-10-2009 at 07:37:05 AM. Reason: Syntax error in the code
retired_member13 is offline  
Old 27-10-2009, 04:43:02 PM     #6 (permalink)

 
SecNam's Avatar
 
Join Date: Jul 2004
Posts: 4,206
SecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond repute
Classified Rating: 100% (1)

couldnt get the above to work ty getting header already sent error at top of the page.
SecNam is offline  
Old 27-10-2009, 05:28:49 PM     #7 (permalink)

 
accelerator's Avatar
 
Join Date: Apr 2005
Location: England
Posts: 4,919
accelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond repute

Quote:
Originally Posted by paullas View Post
im not sure if this is possible but....

is it possible to a certain keyword on a .php page that when is displayed pulls text from a file and inserts in onthe page.

also come to think of it, is this possible with an image also
hope that makes sence lol
I am going to answer your general question in general terms, and that is, php is good for using keywords to retrieve data or files.

Rgds
accelerator is online now  
Old 27-10-2009, 09:12:06 PM     #8 (permalink)

 
SecNam's Avatar
 
Join Date: Jul 2004
Posts: 4,206
SecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond repute
Classified Rating: 100% (1)

Quote:
Originally Posted by accelerator View Post
I am going to answer your general question in general terms, and that is, php is good for using keywords to retrieve data or files.

Rgds
that helped me (not)
SecNam is offline  
Old 27-10-2009, 10:19:07 PM     #9 (permalink)

 
accelerator's Avatar
 
Join Date: Apr 2005
Location: England
Posts: 4,919
accelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond reputeaccelerator has a reputation beyond repute

These guys should be able to help you:

PHP Freaks Forums - Index

Rgds
accelerator is online now  
Old 27-10-2009, 10:22:01 PM     #10 (permalink)

 
SecNam's Avatar
 
Join Date: Jul 2004
Posts: 4,206
SecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond reputeSecNam has a reputation beyond repute
Classified Rating: 100% (1)

Quote:
Originally Posted by accelerator View Post
These guys should be able to help you:

PHP Freaks Forums - Index

Rgds
cheers squire
SecNam is offline  
Closed Thread



Bookmarks

Thread Tools
Display Modes

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 Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Domain Name Community Replies Last Post
Advertising my service: I develop mini sites. gameboy Services Wanted 1 27-05-2009 10:13:03 AM
Advertising my service: I develop mini sites. gameboy Mini Sites 0 23-04-2009 08:49:19 PM
Dofollow Links jj1 Search Engine Optimisation 7 30-03-2009 12:17:16 PM

75% off Domains at Network Solutions®.


All times are GMT. The time now is 01:40:30 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0 RC 2
All content on Acorn Domains is member generated and is not moderated before posting. All content is viewed and used by you at your own risk and AD does not warrant the accuracy or reliability of any of the information. The views expressed are those of the individual contributors and not necessarily those of AD. Please contact us to report any issues or send a PM to "Admin".