Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Help with simple string
Old 03-26-2008, 02:07 AM Help with simple string
Novice Talker

Posts: 14
Name: Orion Tiller
Trades: 0
I have this code that I need help with. I just want to add the variable affid onto the end of the below string. So if $s="1009" in the php code then I would want the last line to become:

setTimeout('window.location="http://www.domain.com/link.php?o=10&s=1009";', 1);

Can someone please help me?

PHP Code:
 <script>
function redirect() {
        var affid = "<?php echo $s?>";
        setTimeout('window.location="http://www.domain.com/link.php?o=10&s=";', 1);  
 
}  
</script>
otiller is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-26-2008, 05:11 PM Re: Help with simple string
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
see bold:
Code:
<script>
function redirect() {
        var affid = "<?php echo $s; ?>";
        setTimeout('window.location="http://www.domain.com/link.php?o=10&s="+affid;', 1);  
 
}  
</script>
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 03-26-2008, 11:52 PM Re: Help with simple string
Novice Talker

Posts: 11
Name: Tortoise
Trades: 0
Or just:

Quote:
Originally Posted by willcode4beer View Post
see bold:
Code:
<script>
function redirect() {
        setTimeout('window.location="http://www.domain.com/link.php?o=10&s=<?php echo $s; ?>"', 1);  
 
}  
</script>
Tortoise is offline
Reply With Quote
View Public Profile
 
Old 03-27-2008, 10:22 PM Re: Help with simple string
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
lol, even better
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with simple string
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13076 seconds with 12 queries