#1 (permalink)  
Old 04-20-2008, 12:58 AM
Registered User
 
Join Date: Jan 2007
Posts: 99
Insert stuff into php file based on link clicked..

I have the following code on the beginning of my index.php page:

Code:
<?php

error_reporting(0);
include "config.php";
Now, in my config.php I have the following:

Code:
<?php

	$tag_by_default="xxxx";

	$site_title="xxxx";

	$tag_list="xxx, hardcore, punk rock, punk, rock";

?>
On my index I want to make a menu. How would I make it so when someone clicks on a name (for example Misfits) it would insert Misfits where the xxxx is and then load up config.php.. then it would continue with index.php.

When someone clicks say Voodoo Glow Skulls off the menu it'll automatically insert Voodoo Glow Skulls where xxxx is, process config.php, and continue with index.php.

As it is now I'm sitting here starting to make 100's of php pages when I know there's got to be an easier way.

Basically I want a menu on top of my index.php page. In that link it'll contain the name that will go into config.php.
Reply With Quote

  #2 (permalink)  
Old 04-20-2008, 08:24 PM
Leprakawn's Avatar
Moderator
 
Join Date: Jan 2004
Location: Outside, and playing with your invisible friends.
Posts: 1,130
Send a message via AIM to Leprakawn Send a message via Yahoo to Leprakawn
So you want it to function in similar fashion to my question here?

I know mine is for imgs only, but that your content is opened on a single page (not multiple pages) with the correct data displayed.
__________________
Like my spiffy, unique signature?
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Code:
         ...,,.,.,.
        /          \
__oooo__[///]--[\\\]__oooo__
Reply With Quote
  #3 (permalink)  
Old 04-21-2008, 09:58 AM
Registered User
 
Join Date: Jan 2007
Posts: 99
Let me see. I started reading that thread now, thanks. Trying to read it at work in between doing my normal work tasks.

Honestly, what I am doing is having one main page with links that pull up YouTube videos.

For example, if the link says "dead babies" it will pull up all the videos on YouTube pertaining to dead babies on one handy page.

I'm basically putting a few hundred links on my menu, catagorized like A-I, J-M, N-Z or something like that. Under there will be the few hundred links, as well as a search box I already have.

Last edited by yuppicide; 04-21-2008 at 10:02 AM.
Reply With Quote
  #4 (permalink)  
Old 04-21-2008, 02:58 PM
Registered User
 
Join Date: Jan 2007
Posts: 99
I think I figured a bit of the answer out on my own. I forgot one of the files has a search bar in it. You put anything you want in there and it returns a page. Here's the code:

[code]
<form method=get action="{site_url}/search_redirect.php">
<input type=text name=search_tag>
<input type=submit value="Search">
</form>
[code]

Now I just need to figure out how to make it so when someone clicks on say "Voodoo Glow Skulls" link on the menu it makes search_tag = voodoo glow skulls and process the rest.
Reply With Quote
  #5 (permalink)  
Old 04-21-2008, 06:40 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,445
Okay, a quick lesson in GET variables and query strings.

When you use the GET method for a form, all it does is append the form information to the end of the URL. That form information is known as the query string. Basically, a query string is anything that appears after the question mark in a URL.

Therefore, if I were to send you to http://www.example.com/index.php?action=dostuff, it would be exactly the same as if I were to build a form that looks like:
Code:
<form name="myform" action="http://www.example.com/index.php" method="post">
<input type="submit" name="action" value="dostuff" />
</form>
So, if you've got the config.php processing the GET variables from the form, you've already done the hard part. Now, all you need to do is build your URLs.

If you want to make a link that leads the same place as the form example you provided above, all you need to do is add the query string to the end of it.

Therefore, you would build your link like:
Code:
<a href="{{siteurl}}/search_redirect.php?search_tag=Voodoo%20Glow%20Skulls">Click here for Voodoo Glow Skulls</a>
Anything submitted through a form with a GET method is treated the same as a normal query string within PHP. Therfore, you would just use the $_GET variable collection to access that information within your script.

Your code could look something like:
PHP Code:
<?php
if(isset($_GET['search_tag'])) {
echo 
"These are YouTube results for the search term: '".$_GET['search_tag']."'.  Please enjoy them.";
}
I hope that helps. If you have more questions, please don't hesitate to ask.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
  #6 (permalink)  
Old 05-08-2008, 12:12 AM
Registered User
 
Join Date: Jan 2007
Posts: 99
I kind of gave up and paid for some help. I got this guy from the Ukraine. He speaks great English and knew exactly what I needed and did the work fairly cheap. I'm going to give him a bonus and use him again in the future if I have other website ideas.

The site should be ready soon. After he puts the finishing touches I'll change graphics to make it more punk and then stick it online.
Reply With Quote
  #7 (permalink)  
Old 05-08-2008, 07:18 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,445
Glad you got help, but don't forget that we are available to help you out in the future, too. We are all professionals in our given trades, too.

Deadeye and I are both programmers. Leppy's a designer, I believe, with experience in Flash. Allen's a marketing guru. Webnauts is the master of SEO. Till and Zoul are both extremely knowledgeable when it comes to databases.

When you need help, you might want to check with us, too. Who knows, we might just be able to beat the prices you're getting from the Ukraine.

Again, though, I'm glad you were able to get it sorted.
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
  #8 (permalink)  
Old 05-08-2008, 07:48 PM
Allen's Avatar
Administrator
 
Join Date: Dec 2001
Location: Atlanta, Georgia, USA
Posts: 1,049
curtiss, leppy, deadeye, zoul, webnauts - these are your experts, i just make sure the bills get paid

and as curtiss says, you might want to pm them about their rates - im sure they are reasonable and the talent is top notch.
Reply With Quote
  #9 (permalink)  
Old 05-16-2008, 11:47 AM
Registered User
 
Join Date: Jan 2007
Posts: 99
In response to this topic I originally opened I thought I'd show you what I was creating.

Apunkalypse Now!

The name is a play off the movie Apocalypse Now, which I came up with this name sometime in the early 90's. Try the site out.. you can click videos and it'll open them with comments right from YouTube.

- On the main page everytime you refresh you get random videos from one punk band
- The menu up top reads a text file to know what letters of the alphabet it needs to display. It
displays punk band names that I list in the text file.
- When you click one of those band names it puts the following words into YouTube: bandname, punk, rock and pulls up videos from that band. This is what I was trying to get help with how to accomplish this. Otherwise I'd have to have made 100's of pages for the band. With PHP it does it all automatically based on what link is clicked.

There are a few kinks my designer has already fixed most of them, like for instance if you click Face to Face it won't correctly pull the right videos to the front of the search results. We've made it now so the text file can contain additional keywods to put into YouTube. I can put additional keywords as I see fit.

I also have a links button coming for my favorite links and some more banner advertisements that rotate.

Once the design finishes the little kinks I'm going to start some advertising on various punk related websites.

I'm also going to "mirror" the site to make one for Hip-Hop music and some other things.

I'm also changing the graphics/colors a bit.

If you're interested to know I offered $45 US to get the menu up top working (I made the buttons) and read the text file and make it automatically put keywords into YouTube and grab videos. I then paid him $15 to make some modifications (ie: read multiple keywords from text file, insert rotating banners).

Last edited by yuppicide; 05-16-2008 at 11:50 AM.
Reply With Quote
  #10 (permalink)  
Old 05-18-2008, 01:19 AM
Leprakawn's Avatar
Moderator
 
Join Date: Jan 2004
Location: Outside, and playing with your invisible friends.
Posts: 1,130
Send a message via AIM to Leprakawn Send a message via Yahoo to Leprakawn
Looks like the kids will find great use of your site. But I must ask... what is up with the huge amount of dead space at the bottom?

__________________
Like my spiffy, unique signature?
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Code:
         ...,,.,.,.
        /          \
__oooo__[///]--[\\\]__oooo__
Reply With Quote
  #11 (permalink)  
Old 05-19-2008, 08:46 AM
Registered User
 
Join Date: Jan 2007
Posts: 99
No clue about the dead space, nor do I really mind that much. It was a script that generated the original page, so I didn't do 99% of the work. All I did was have it modified to become dynamic.
Reply With Quote
  #12 (permalink)  
Old 05-20-2008, 01:57 AM
Leprakawn's Avatar
Moderator
 
Join Date: Jan 2004
Location: Outside, and playing with your invisible friends.
Posts: 1,130
Send a message via AIM to Leprakawn Send a message via Yahoo to Leprakawn
After thinking about it, I bet you will be filling it in with other things as your site progressively gets more attn.
__________________
Like my spiffy, unique signature?
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Code:
         ...,,.,.,.
        /          \
__oooo__[///]--[\\\]__oooo__
Reply With Quote
  #13 (permalink)  
Old 05-20-2008, 12:44 PM
Registered User
 
Join Date: Jan 2007
Posts: 99
Yep. I was thinking of reviews, concert calendar, etc.
Reply With Quote
  #14 (permalink)  
Old 05-30-2008, 02:41 PM
Registered User
 
Join Date: Jan 2007
Posts: 99
Since putting the site online about 2 weeks ago I've seen over 690 unique visits. I'm averaging about 38 uniques a day. This is with no advertisement yet.

I put it up for sale for $150 on Sitepoint and have offered to design sites just like this one, but with different content and color scheme at a really low price.

If it doesn't sell I'll do some advertising. I found one place I can get 1000 impressions for $10 bucks on a punk website.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Force a menu button to read text file (not cached) Bad Inferno Programming and Scripting 1 06-21-2007 09:41 AM
Problem with writing file in perl gugabaga Programming and Scripting 1 06-27-2006 09:17 AM
Passing Variables to an .asx file Jami Programming and Scripting 2 04-26-2006 05:38 PM
Creating a file and saving it locally - PHP curtiss Programming and Scripting 6 03-25-2006 12:26 PM
How to create a PHP "Top Ten" link list? Leprakawn Programming and Scripting 1 01-20-2006 09:19 AM


All times are GMT -5. The time now is 12:02 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter