کدهای زیر را در هاست خود فرار دهید:
کد زی را تحت عنوان index.php دخیره نمایید:
کد HTML:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<!--<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256">
<LINK href="main.css" rel="stylesheet" type="text/css">
<title>Untitled Document</title>
<!-- ... your form code here ...
<style>
body {
font-family: "Microsoft Sans Serif ";
}
ul {
list-style:none;
width: 500px;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
}
#title {
background: -moz-linear-gradient(center top , #E6E6FF, #CACAFA) repeat scroll 0 0 rgba(0, 0, 0, 0);
border-bottom: 1px solid #FFFFFF;
color: #FFFFFF;
font-size: 16pt;
font-weight: bold;
padding-bottom: 4px;
padding-top: 8px;
text-align: center;
text-shadow: 0 1px 1px #000000;
position: inherit;
right: 444px;
display: compact;
margin: 39px 77px 15px 16px !important;
overflow: hidden;
}
#footer {
height:12px;
padding-bottom:6px;
padding-top:6px;
background:#CACAFA;
-moz-border-radius-bottomright:15px;
-moz-border-radius-bottomleft:15px;
-webkit-border-bottom-left-radius: 15px;
-webkit-border-bottom-right-radius: 15px;
}
#file:hover {
background: #EBEBFF;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#E6E6FF', endColorstr='#F2F2FF');
background: -webkit-gradient(linear, left top, left bottom, from(#E6E6FF), to(#F2F2FF));
background: -moz-linear-gradient(top, #E6E6FF, #F2F2FF);
}
#file {
cursor:pointer;
padding-left:10px;
padding-top:8px;
padding-bottom:8px;
background:#DCDCFC;
border-bottom: solid 1px white;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#F0F0FF', endColorstr='#DCDCFC');
background: -webkit-gradient(linear, left top, left bottom, from(#F0F0FF), to(#DCDCFC));
background: -moz-linear-gradient(top, #F0F0FF, #DCDCFC);
}
#formcontainer {
margin-left: auto;
margin-right: auto;
}
#search-container {
background-color: #00598E;
border: 0 none;
border-radius: 0 1px 1px 0;
color: #EEEEEE;
direction: ltr;
display: block;
font-family: Tahoma,Geneva,sans-serif;
font-size: 17px;
height: 36px;
margin: 0;
padding: 5px;
text-align: left;
width: 160px;
}
#download-button {
background: -moz-linear-gradient(center top , #7DB72F, #4E7D0E) repeat scroll 0 0 rgba(0, 0, 0, 0);
border: 1px solid #538312;
color: #E8F0DE;
position: relative;
top: 50px;
position: relative;
font-size: 197%;
right: 50%;
}
# a {
text-decoration:none;
color:black;
}
#download {
cursor:pointer;
padding-left:10px;
padding-top:8px;
padding-bottom:8px;
background:ActiveBorder;
border-bottom: solid 1px white;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#F0F0FF', endColorstr='#DCDCFC');
background: -webkit-gradient(linear, left top, left bottom, from(#F0F0FF), to(#DCDCFC));
background: -moz-linear-gradient(top, #F0F0FF, #DCDCFC);}
</style>
-->
</head>
<body>
<label >
<div align="right" >
</div>
</label>
<form method="POST" action="requset.php" style='width:auto;background:khaki' dir=rtl >
<table>
<tr>
<td id="title" dir=rtl>لطفا ً عدد مربوط را وارد نماييد </td>
</tr>
<tr>
<td dir=rtl id='file' style='width:50%;margin:-3px;' > لطفا ً آدرسي اينترنتي ديتابيس مورد نظر را وارد نماييد </td>
<td><input id="search-container" type="text" name="ssurl" dir=ltr style='width:300%;margin:-3px;border:2px inset #eee' value="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=6180383&queryText%3Dpower" /></td>
</tr>
<!-- ... your form code here ...
<tr>
<td>لطفاً در صورت تمايل ايميل خود را جهت ارسال فايل به آن وارد نماييد </td>
<td><input type="text" name="email" value="yourname@gmail.com"/></td>
</tr>
-->
</table>
<input id="download-button" type="submit" name="ssurlsubmit" value="خريد " />
</form>
</body>
</html>
و کد زیر را هم در همان فولدر تحت نام requset.php ذخیره نمایید:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256">
<?php
/**
$css = file_get_contents('main.css');
echo $css;
* @author nnnnn
* @copyright 2012
*/
//removes string from the end of other
if (isset($_POST['ssurlsubmit'])) {
function removeFromEnd($string, $stringToRemove) {
$stringToRemoveLen = strlen($stringToRemove);
$stringLen = strlen($string);
$pos = $stringLen - $stringToRemoveLen;
$out = substr($string, 0, $pos);
return $out;
}
echo "<pre>";
$num=$url;
if($num== '1111'){
$url='www.google.com'}
else{
$url='www.freepapers.tk'
}
$ToGo=$url;
$data = urlencode($data);
$curl_connection =curl_init($ToGo);
//curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
//perform our request
$result = curl_exec($curl_connection);
curl_error($curl_connection);
//close the connection
curl_close($curl_connection);
echo $result ;
echo "</pre>";
}
?>
شما می توایند بخش حلقه if را دراین مد به ظرز دلخواه خود ویرایش نمایید.