Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 01-09-2007, 09:58 PM   #1 (permalink)
Junior Member
 
Join Date: 08-01-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

kf9211 is liked by many
how do i create a javascript code that allows me to add links

How do i create a javascript code that allows me to add links from 1 place to a bunch of other places. Like what google adsense does.

sorry if this question dosen't make sense but I couldn't fiqure out another way to word it.

kf9211
kf9211 is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-10-2007, 12:12 PM   #2 (permalink)
v7n Mentor
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,330
iTrader: 0 / 0%
Latest Blog:
Starting p90x today

Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Hmm.. I'm a little confused at to what you are saying.

So, you're saying, transferring links from 1 page to another?
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is online now  
Add Post to del.icio.us
Reply With Quote
Old 01-21-2007, 07:09 PM   #3 (permalink)
Junior Member
 
Join Date: 08-01-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

kf9211 is liked by many
kind of what I want to do is make it so that if i add a link to every page of my website I don't have to do it to every page manualy
thank you
kf9211
ps. it dosen't have to be javascript I just thought that that would be what you would use to do that but now that I think about it it would probably be rss or something else
kf9211 is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-21-2007, 07:25 PM   #4 (permalink)
Senior Member
 
Join Date: 01-02-07
Location: PA, USA
Posts: 191
iTrader: 0 / 0%
Latest Blog:
None

Arenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebody
Send a message via ICQ to Arenlor Send a message via AIM to Arenlor Send a message via MSN to Arenlor Send a message via Yahoo to Arenlor
So like an include of them on every page, sort of along the idea of the stuff on the left side on this => http://doumc.com ? if so just create the html page and then in PHP include("name.html"); or require, or include_once or require_once whatever. I'm not sure what the equivalent of an include function is in JS though.
Arenlor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-21-2007, 08:00 PM   #5 (permalink)
Junior Member
 
Join Date: 08-01-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

kf9211 is liked by many
how would i include ("name.html") in php
kf9211 is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-21-2007, 08:49 PM   #6 (permalink)
Senior Member
 
Join Date: 01-02-07
Location: PA, USA
Posts: 191
iTrader: 0 / 0%
Latest Blog:
None

Arenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebody
Send a message via ICQ to Arenlor Send a message via AIM to Arenlor Send a message via MSN to Arenlor Send a message via Yahoo to Arenlor
PHP Code:
<?php include("name.html"); ?>
of course your file doesn't have to be name.html it can be anything.
Arenlor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-22-2007, 10:02 AM   #7 (permalink)
v7n Mentor
 
digiweb's Avatar
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 722
iTrader: 1 / 100%
digiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of light
Send a message via Yahoo to digiweb Send a message via Skype™ to digiweb
As above, plus, you can't do that in javascript unless you set javascript as a server side language which I've never seen done. Pages (with your links) are served by the server.

The server downloads html and javascript to the browser. The browser / html / javascript may not write to the server. The html and javascript send server requests, and the server carries them out. So you have to have a server side language to process the request.

browser (client) asks for web page

Server (IIS, Apache, whatever) sends html and/or javascript to browser(client)

User inputs links into browser, submits

Form submitted sends request "please add these links" and data (the links the user input) to server

The server hands off request to server side processor (php, asp, whatever)

The processor receives link strings, adds them to some file your site will display, hands control back to the server

Server sends "thanks for your links, we're working on it" back to the client.
digiweb is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 08:02 AM   #8 (permalink)
Member
 
Join Date: 01-22-07
Location: India
Posts: 52
iTrader: 0 / 0%
Latest Blog:
None

Gurpartap is liked by somebodyGurpartap is liked by somebodyGurpartap is liked by somebodyGurpartap is liked by somebody
Send a message via MSN to Gurpartap Send a message via Yahoo to Gurpartap
Something of this sort?:

http://webicio.us/exlinks/index.php
Quote:
Username: admin
Password: gnn
and include this file on all the pages:

http://webicio.us/exlinks/links.php

and it allows you to configure looks, etc. Maybe if that's your need.
Gurpartap is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 10:18 AM   #9 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 247
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
Quote:
Originally Posted by CarolineBogart View Post
As above, plus, you can't do that in javascript unless you set javascript as a server side language which I've never seen done. Pages (with your links) are served by the server.
Granted JS is CLIENT side, not SERVER side. But, why cant you have in a JS file:
Code:
<html> <head> <title>V7N</title> </head> <body> <script src="links.js" language="javascript" type="text/javascript"></script> </body> </html>
Code:
document.write("<a href='link1.htm'>Link 1</a><br />"); document.write("<a href='link2.htm'>Link 2</a><br />"); document.write("<a href='link3.htm'>Link 3</a><br />");
From here you will need the
Code:
<script src="links.js" language="javascript" type="text/javascript"></script>
in every page's nav section

Edit "links.js" as needed....
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 01:58 PM   #10 (permalink)
v7n Mentor
 
digiweb's Avatar
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 722
iTrader: 1 / 100%
digiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of light
Send a message via Yahoo to digiweb Send a message via Skype™ to digiweb
Quote:
Originally Posted by Radnor View Post
Granted JS is CLIENT side, not SERVER side. But, why cant you have in a JS file:
Code:
<html> <head> <title>V7N</title> </head> <body> <script src="links.js" language="javascript" type="text/javascript"></script> </body> </html>
Code:
document.write("<a href='link1.htm'>Link 1</a><br />"); document.write("<a href='link2.htm'>Link 2</a><br />"); document.write("<a href='link3.htm'>Link 3</a><br />");
From here you will need the
Code:
<script src="links.js" language="javascript" type="text/javascript"></script>
in every page's nav section

Edit "links.js" as needed....
Cool, I must have misunderstood the requirement.

I thought you wanted to accept an input from the user that would write the links to a file. If you've already got the links than this or the include(name.htm) above will work as well.
digiweb is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 02:20 PM   #11 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 247
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
Quote:
Originally Posted by CarolineBogart View Post
I thought you wanted to accept an input from the user that would write the links to a file
NO! I would NEVER allow an outsider add links to my page. Who knows where they would send people.

This will work too if you can have server side include(s)

Code for v7n.SHTML
Code:
<html> <head> <title>V7N</title> </head> <body> <!--#include file="links.htm" --> </body> </html>
code for links.htm
Code:
<a href='link1.htm'>Link 1</a><br /> <a href='link2.htm'>Link 2</a><br /> <a href='link3.htm'>Link 3</a><br />
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 06:23 PM   #12 (permalink)
Junior Member
 
Join Date: 08-01-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

kf9211 is liked by many
thanks so much for helping me thats exactly what i wanted to do
kf9211 is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 08:47 PM   #13 (permalink)
Junior Member
 
Join Date: 08-01-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

kf9211 is liked by many
wait never mind thats not what i want to do. what the problem is is that i have a website that has many pages and i have some of the links already however i plan on adding some later so instead of doing it manualy I wanted to know if there is way to make it so that you could add something like javascript or php or any other scripting language to make it so you could create a seperate page that would put that html, javascript etc. onto that page that way you would only have to change 1 page as apposed to having to change every page manualy. (also it dosen't have to be a scripting language it could also be a program that could do it.)
thank you
kf9211
kf9211 is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 08:51 PM   #14 (permalink)
v7n Mentor
 
digiweb's Avatar
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 722
iTrader: 1 / 100%
digiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of light
Send a message via Yahoo to digiweb Send a message via Skype™ to digiweb
The answer you seek is within you.
digiweb is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 08:55 PM   #15 (permalink)
Junior Member
 
Join Date: 08-01-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

kf9211 is liked by many
? umm?
kf9211 is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 09:04 PM   #16 (permalink)
Senior Member
 
Join Date: 01-02-07
Location: PA, USA
Posts: 191
iTrader: 0 / 0%
Latest Blog:
None

Arenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebody
Send a message via ICQ to Arenlor Send a message via AIM to Arenlor Send a message via MSN to Arenlor Send a message via Yahoo to Arenlor
First page name it whatever you want .txt
HTML Code:
<table><tr><td valign="top" width="180px"><a href="firstpage.html">First Page</a><br /> <a href="secondpage.asp">Second Page</a><br /> <a href="thirdpage.php">Third Page</a></td>
That will create it vertically. Make it valid as you will. width can be whatever you want, and should be defined in CSS for validity. Have td.left have the width and have it be class="left" in the td there.

Second page (the one they'll view) name it whatever you want .php
PHP Code:
<?php
echo "<html><head><title>Title</title></head><body>";
include(
'whateverYouNamedIt.txt');
echo 
"<td><p>your page content</p></td></tr></table></body></html>";
That should be how your every page is, if you're like me and just include a head and a body file you can have the body file be </td></tr></table></body></html> and the head file be <html><head><title>TITLE</title></head><body><table><tr><td>your links</td><td> then you can just write your pages as normal and just include that. If you want your links at the top tell me and I'll give you an example of how to do that.
Arenlor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-23-2007, 09:14 PM   #17 (permalink)
v7n Mentor
 
digiweb's Avatar
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 722
iTrader: 1 / 100%
digiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of light
Send a message via Yahoo to digiweb Send a message via Skype™ to digiweb
Click the link, glasshoppah
you want the include stmt
digiweb is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-24-2007, 07:58 AM   #18 (permalink)
Contributing Member
 
Join Date: 07-30-05
Posts: 247
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
What program are you using to edit your pages with?
Radnor is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-26-2007, 05:16 PM   #19 (permalink)
Junior Member
 
Join Date: 08-01-06
Posts: 16
iTrader: 0 / 0%
Latest Blog:
None

kf9211 is liked by many
i'm not using any program to edit it i'm just using html
kf9211 is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create this Javascript form? ladan Coding Forum 6 06-12-2009 03:36 AM
Getting Rid of Javascript Links Basicskills Coding Forum 8 04-14-2006 05:01 PM
Javascript history code Jason Web Design Lobby 1 12-15-2004 07:50 AM
javascript code for unwanted horizontal scrollbar dinus Coding Forum 1 01-09-2004 12:31 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 04:59 PM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.