| | |
Problems with redirecting...please help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved
![]() |
•
•
Join Date: Dec 2008
Posts: 8
Reputation:
Solved Threads: 0
Hello, my script is giving me headache for two days. I have a paid to click site, when user clicks on paid links my script displays surf page, where i have a timer and an iframe that displays sponsored site below the timer. After the timer loads users have to pass captcha and after that success icon shows up. I wanted to change this success icon into redirecting to sponsored site and braking my frame.
So far i am very close but i'm bad at javascript and php so i probably have some noob mistakes.
View.php is the page where users see timer and iframe, in visit.php hides all code that displays captcha, error icon, success icon, credits user's acccount...
This is the last part of visit.php that displays success icon after user clicked right captcha code:
I tried to put this:
because <?php echo $ad_row['url']; ?>, displays the real link of sponsored ad (it's used for iframe) in view.php, but ofcorse it doesn't work....
there were these functions in view.php that I copied to visit.php but it didn't help:
I don't know how to put another echo in echo

Can you plase solve these i tried googling for hours but no luck
Thank you a lot!
So far i am very close but i'm bad at javascript and php so i probably have some noob mistakes.
View.php is the page where users see timer and iframe, in visit.php hides all code that displays captcha, error icon, success icon, credits user's acccount...
This is the last part of visit.php that displays success icon after user clicked right captcha code:
PHP Syntax (Toggle Plain Text)
// HOORAY! SUCCESS! echo <<<EOT document.getElementById('timer').setAttribute('class','success'); document.getElementById('timer').innerHTML='Success!'; EOT; destroy(); ?>
I tried to put this:
PHP Syntax (Toggle Plain Text)
// HOORAY! SUCCESS! echo <<<EOT window.location= "<?php echo $ad_row['url']; ?>"; EOT; destroy(); ?>
because <?php echo $ad_row['url']; ?>, displays the real link of sponsored ad (it's used for iframe) in view.php, but ofcorse it doesn't work....
there were these functions in view.php that I copied to visit.php but it didn't help:
PHP Syntax (Toggle Plain Text)
$ad_id=limpiar($_GET["ad"]); $ad_result=mysql_query("SELECT * FROM ads WHERE id='$ad_id'"); $ad_row=mysql_fetch_array($ad_result);
I don't know how to put another echo in echo

Can you plase solve these i tried googling for hours but no luck

Thank you a lot!
You don't have to reopen the php tags in a heredoc (heredoc is the EOT thing you're using).
So if
The curly braces are for the array value.
My source for heredoc info is http://www.hudzilla.org/php/2_6_3.php.
(Tell me if this worked.)
So if
$ad_row['url'] contains the url, you can just include it as you would any other variable in php: PHP Syntax (Toggle Plain Text)
// HOORAY! SUCCESS! echo <<<EOT window.location= "{$ad_row['url']}"; EOT; destroy(); ?>
The curly braces are for the array value.
My source for heredoc info is http://www.hudzilla.org/php/2_6_3.php.
(Tell me if this worked.)
•
•
Join Date: Dec 2008
Posts: 8
Reputation:
Solved Threads: 0
Hm... it is weird what happens now....
I have this in view.php:
And when i view page source in firefox i can see the real url of advertiser, but when i added this to visit.php it redirects to mydomain.com/view.php?ad=xxx again, not the real url. Maybe I need something to brake frame? Can you or someone help with this?
Thanks in advance, a lot!
I have this in view.php:
PHP Syntax (Toggle Plain Text)
<iframe src="<?php echo $ad_row['url']; ?>" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%" id="site"></iframe>
And when i view page source in firefox i can see the real url of advertiser, but when i added this to visit.php it redirects to mydomain.com/view.php?ad=xxx again, not the real url. Maybe I need something to brake frame? Can you or someone help with this?
Thanks in advance, a lot!
Last edited by masterOFwww; Dec 29th, 2008 at 6:29 pm.
•
•
Join Date: Dec 2008
Posts: 8
Reputation:
Solved Threads: 0
Hey, i found the problem, i was missing this:
Thank you kanaku for solving this!
PHP Syntax (Toggle Plain Text)
$ad_row=mysql_fetch_array($ad_result);
Thank you kanaku for solving this!
![]() |
Similar Threads
- page not redirecting - redirect2page('members.php'); (PHP)
- Desktop Background Problems (Windows NT / 2000 / XP)
- IE Explorer/Search Engine problems! (fake/redirect search results) (Viruses, Spyware and other Nasties)
- Browser Redirect/System Restore Problems/etc.... (Viruses, Spyware and other Nasties)
- IE redirecting to other site from any Google result (Viruses, Spyware and other Nasties)
- Browser problems (Windows NT / 2000 / XP)
- Help Please Browser Problems (Web Browsers)
- Desktop Popups (AHH!) and CWS Infection (Related problems?) (Viruses, Spyware and other Nasties)
- Spyware is Redirecting Homepage (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: mssql,sqlsrv,obdc_connect
- Next Thread: multiple images
| Thread Tools | Search this Thread |
.htaccess access alexa apache api array autocomplete beginner broken cakephp class cms code convert cron curl database dataentry date directory display dropdown duplicates dynamic email emptydisplayvalue encode error execute explodefunction fairness file firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include indentedsubcategory ip javascript joomla keywords limit link login mail menu methods multiple multipletables mysql network newsletters object oop passwords paypal pdf php provider query radio random recursive redirect remote script search secure securephp server sessions shot simple source space sql subscription system table tutorial tutorials upload url user validator variable video voteup web youtube





