Go Back   HostGator Peer Support Forums > Public Forums > Suggestions

Notices

Reply
 
Thread Tools
  #1  
Old 09-24-2007, 09:22 AM
funky22 funky22 is offline
Hatchling Croc
 
Join Date: Sep 2007
Posts: 5
Default how can i put this 2 codec together?

hello, i have a php code and its linking to a download link which was added:
1
Code:
<?php
  $id = $_GET['id'];
  $query = mysql_query("SELECT link FROM links WHERE rand = '$id'");
  $link = mysql_result($query,"link");
  echo "<a href='".$link."' target='_blank'>Download</a>";
  echo '<meta http-equiv="refresh" content="500;url='.$link.'">';
  ?>

now i want, when people click on download , the download link will be opened in a popup, but in this popup it will say again: download, if they click on it, then must be relinked to the link


i have created a popup.html with the next content:
2

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function DisplayURL(url)
{
    document.getElementById('url').innerHTML = url;
}

function OpenURL(url)
{
    parent.OpenURL(url);
}
</script>
</head>

<body>
<p>download</p>
<p><div id='url'></div></p>
</body>
</html>

now i want if they click on download, there must come first a popup, so i have the next code:
3
Code:
<SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>
 <!--
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();}


// -->

function ShowPopup(url)
{
    w = window.open('popup.html','Download','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=520,height=580,left = 252,top = 184');
    w.onload = function()
    {
        url = "<a href='"+url+"' onclick=\"OpenURL('"+url+"');return false;\">Download From Rapidshare Source!</a>";
        w.DisplayURL(url);
    }
}

function OpenURL(url)
{
    location.href=url;
}

</script><head>
<meta http-equiv="Content-Language" content="tr">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
<title>{@SITE_NAME}</title>
<style type="text/css">
<!--
.style6 {color: {@ACTUAL_URL}}
-->
</style>
</head>

<body>

<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
<p align="center" class="style6"><a href="{@ACTUAL_URL}" onClick="ShowPopup('{@ACTUAL_URL}');return false;">Downloads</a></p>
<p align="center" class="style6"><a href="javascript:NewWindow('{@ACTUAL_URL}','popup','550','290','center','front');"></a></p>
<p align="center" class="style6">&nbsp;</p>

now i want to put the code from 1 in 3, but how can i do that?

in code 3, its linking to @ACTUAL_URL , this mst be changed with the code in 1, but i dont understand, can someone please help me

thnx,
Reply With Quote
  #2  
Old 09-24-2007, 09:48 AM
regentronique's Avatar
regentronique regentronique is offline
King Croc
 
Join Date: Aug 2007
Location: Quebec,Canada
Posts: 969
Default Re: how can i put this 2 codec together?

Everything like "{@SITE_NAME}" are replaceable parameters. They must be replaced by the actual values you need to be there.

As an example : "{@SITE_NAME}" would be replaced with "Your special download page title".
Reply With Quote
  #3  
Old 09-24-2007, 10:59 AM
funky22 funky22 is offline
Hatchling Croc
 
Join Date: Sep 2007
Posts: 5
Default Re: how can i put this 2 codec together?

i dont understand can you please do it for me, if u want or need i can send u 5$ paypal, i really need this, hope u or someone else will help me

thnx,
Reply With Quote
  #4  
Old 09-24-2007, 11:59 AM
regentronique's Avatar
regentronique regentronique is offline
King Croc
 
Join Date: Aug 2007
Location: Quebec,Canada
Posts: 969
Default Re: how can i put this 2 codec together?

There is a lot of missing code and explanation to help more.

As an example :

Section #1- There is no statement to first establish a connection to your database.

Section #2- Nothing will occur "if they click on download" because download is text not a link.

Section #3- There is no way to know from where the variables could come from, more details should be given for the order of events and the names of the PHP and HTML files.
Reply With Quote
  #5  
Old 09-24-2007, 01:32 PM
funky22 funky22 is offline
Hatchling Croc
 
Join Date: Sep 2007
Posts: 5
Default Re: how can i put this 2 codec together?

yes there is

at the top of the php file:

<?php
include "config.jmz.php";
connect(1);
?>
Reply With Quote
  #6  
Old 09-24-2007, 01:44 PM
regentronique's Avatar
regentronique regentronique is offline
King Croc
 
Join Date: Aug 2007
Location: Quebec,Canada
Posts: 969
Default Re: how can i put this 2 codec together?

Like i said, lots of missing code.

You just answered to section #1 missing code, not for the rest of the sections problems.

How can you "click" on a paragraph "<p>download</p>"?

There is no way to logicaly help you more without more info and correct code...
Reply With Quote
Reply

Bookmarks

Thread Tools

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 Off
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 10:44 PM.