Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-28-2017, 04:10 AM   #1
starling
Confirmed User
 
Industry Role:
Join Date: Jan 2017
Posts: 312
Help with some code

This one should be quite simple but i'm struggling to get it right. I need a button with an input to take a number and store it into a domain. Like the ccbill thing you see where you put your number in and it will replace:
whateverdomain.com/xxxxxxalidland
to
whateverdomain.com/123456alidland
Ive tried javascript getElementByID but as i'm storing the button input as a variable it always comes up wrong I keep getting value="whatever" replacing the whole domain

I know I could use php to echo a variable into the code but i'm not sure if this can be implemented into a wordpress page can it? Would I have to build a plugin?

Any help would be appreciated
starling is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-28-2017, 05:31 AM   #2
starling
Confirmed User
 
Industry Role:
Join Date: Jan 2017
Posts: 312
Code:
<p>So this would be the paragraph and<span id="your_paragraph">THIS</span>is the word to be changed</p>
INPUT HERE: <input type="text" id="theText" />
<input type="button" id="btn" value="Update" />

<script>
var span = document.getElementById('your_paragraph');
var btn = document.getElementById('btn');
var txt = document.getElementById('theText');
btn.onclick = function(){
    span.textContent = txt.value;
};
</script>
The problem is it only works on one element instead of multiple. Is there a way to make it change all instances of the word to the same input, if I had multiple paragraphs?
starling is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-28-2017, 06:51 AM   #3
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,503
Quote:
Originally Posted by starling View Post
Code:
<p>So this would be the paragraph and<span id="your_paragraph">THIS</span>is the word to be changed</p>
INPUT HERE: <input type="text" id="theText" />
<input type="button" id="btn" value="Update" />

<script>
var span = document.getElementById('your_paragraph');
var btn = document.getElementById('btn');
var txt = document.getElementById('theText');
btn.onclick = function(){
    span.textContent = txt.value;
};
</script>
The problem is it only works on one element instead of multiple. Is there a way to make it change all instances of the word to the same input, if I had multiple paragraphs?
You would need to go through all elements that can contain the word to be replaced and replace each one individually I would think.

.
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-28-2017, 06:59 AM   #4
starling
Confirmed User
 
Industry Role:
Join Date: Jan 2017
Posts: 312
Quote:
Originally Posted by sarettah View Post
You would need to go through all elements that can contain the word to be replaced and replace each one individually I would think.

.
I managed to get it with a jquery find/replace code thank you
starling is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-28-2017, 07:14 AM   #5
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
What is the purpose? Hide the affiliate links?
Googlebot has been proven to read and execute JavaScript now -- if that is the purpose it is a waste of time.

This may work for inserting php code -- not an endorsement -- use at your own risk.
https://adinserter.pro/about
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-28-2017, 07:26 AM   #6
starling
Confirmed User
 
Industry Role:
Join Date: Jan 2017
Posts: 312
Quote:
Originally Posted by Barry-xlovecam View Post
What is the purpose? Hide the affiliate links?
Googlebot has been proven to read and execute JavaScript now -- if that is the purpose it is a waste of time.

This may work for inserting php code -- not an endorsement -- use at your own risk.
https://adinserter.pro/about
I'm making a backend for affiliates, I'll give it a look.
starling is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-28-2017, 07:27 AM   #7
TACNet
Confirmed User
 
TACNet's Avatar
 
Industry Role:
Join Date: Jan 2009
Posts: 446
Quote:
Originally Posted by Barry-xlovecam View Post
Googlebot has been proven to read and execute JavaScript now
Hi

Is that true ? Ive often wondered

Sorry off topic i know
__________________


TAC Amateurs - The World's LARGEST Amateur Porn Network
TACNet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-28-2017, 08:33 AM   #8
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Quote:
Originally Posted by TACNet View Post
Hi

Is that true ? Ive often wondered

Sorry off topic i know
Thats what I have read at the big SEO sites -- they did tests.

My old JS 'you better have my cookie' script was detected by Google and all of those pages ended up delisted (I think so) a couple of years ago when this news was disclosed. Harder to run googlebot in circles these days. Time to develop anti-googlebot warfare and lots of cheap new gTLD domains on cloud VPS servers that will have new ips. Today most big hosts are multinational with multi IP 'A - B' blocks -- problem is the AS blocks (ASN) are assigned to the Hosting Co.

So does Google check AS blocks now? IDK.
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
variable, input, button, domain, code, replacing, wrong, value=whatever, build, plugin, appreciated, page, wordpress, echo, php, implemented, store, struggling, simple, ccbill, javascript, getelementbyid, replace, storing



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.