min fråga är hur kan man göra så att admin måste godsänna banner att den syns eller inte syns typ 0 eller 1
ansöknins del till den
<?
echo "<link href='css/style.css' rel='stylesheet' type='text/css'> <font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>»
Affiliation rulez</font>
<table width='400' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td><font color='#666666'><img src='imgs/linemw.gif' width='100%' height='5'></font></td>
</tr>
</table>
<font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>+</font>
<font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>important:
u will have to link me. otherwise don´t even submit your site!<br>
<br>
+ No rasism.<br>
+ No warez.<br>
+ No Pornografi.<br>
+ All other kind of material which can offend people.<br>
+ High count of uniq visitors.<br>
+ If you break the rulez i might cancel our affiliation immediate without warning.<br>
<br>
<br>
» Upload data</font>
<table width='400' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td><font color='#666666'><img src='imgs/linemw.gif' width='100%' height='5'></font></td>
</tr>
</table>
<font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>+
The button has to be exactly 88x31 pixel in size, .gif and has the maximum filesize
of 20480 bytes.<br>
+ use on your button file, the same name as your site.<br>
+ All of your website data will be automatically showed in the affiliation section.
</font><font size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
<br>
<br>
</font>
<table width='387' border='0' cellpadding='0' cellspacing='0'>
<form name='form1' method='post' action='upload.php' enctype='multipart/form-data' onsubmit='return checkform()'>
<tr>
<td width='106'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Name:</font></td>
<td width='260'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>
<input id='wmname' name='wmname' type='text' class='editbox' size='48'>
</font></td>
</tr>
<tr>
<td><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>E-mail:</font></td>
<td><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>
<input type='text' id='wmemail' name='wmemail' class='editbox' size='48'>
</font></td>
</tr>
<tr>
<td width='106'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Site
name:</font></td>
<td width='260'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>
<input id='sitename' name='sitename' type='text' class='editbox' size='48'>
</font></td>
</tr>
<tr>
<td><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Site url:</font></td>
<td><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>
<input id='sitelink' name='sitelink' class='editbox' size='48' value='http://'>
</font></td>
</tr>
<tr>
<td><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Upload button:</font></td>
<td><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>
<input type='file' size='36' name='imagefile' class='editbox' maxlength='255'>
<input type='hidden' name='MAX_FILE_SIZE' value='20480'>
</font></td>
</tr>
<tr>
<td></td>
<td><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>
<input type='submit' id='Submit' name='Submit' value='Submit' class='button2'>
<input type='reset' id='Submit12' name='Submit1' value=' Reset ' class='button2'>
</font></td>
</tr>
</form>
</table>
<font size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
<br>
<font color='#9CA1B4'>» </font>In case you need, please use <a href=\'mail.php\'>this</a>
form to contact me.</font>";
?>
affilaites script
<?
/*
This works with mysql as u can see. This only write out the tables and so on and so on.
U can add things to the DB or remove, this will works fine :p
I don´t use any form to add the thinks to the DB.
If u wanna use this i think u just have to change the first table size(387)
And the colors i´m using.
*/
include "tdata.php";
//-------------------
echo"<table width='350' border='0' cellpadding='0' cellspacing='0'>
<tr><td></td></tr><tr><td>
<table width='350' border='0' cellpadding='0' cellspacing='0'>
<tr>";
//--- Write out the first button -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$bts = 0;
$result = mysql_query("SELECT * FROM affillisteng ORDER BY RAND()");
$row = mysql_fetch_array($result);
$id = $row[id];
echo"<td><table width='88' height='31' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
<tr><td bgcolor='#ffffff'><div align='center'><a href='inouteng.php?outid=$id' target='_blank'>
<IMG SRC='$row[st_button]' WIDTH=88 HEIGHT=31 ALT='$row[st_name]
In: $row[countin] | Out: $row[countout]' border='0' style='filter:alpha(opacity=50)' onMouseOver='nereidFade(this,100,60,15)' onMouseOut='nereidFade(this,50,75,15)'></a></div></td></tr>
<tr><td></td></tr></table></td>";
//---- all next buttons ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
while($row = mysql_fetch_array($result)){
$id = $row[id];
//----- This will "br" after write 3 buttons per line, in this case will close </tr> tag and open a new one ----------------------------------------------------------------------------------------------------------
if($bts == 3){
echo "</tr><tr><td><table width='88' height='31' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
<tr><td bgcolor='#ffffff'><div align='center'><a href='inouteng.php?outid=$id' target='_blank'><IMG SRC='$row[st_button]' WIDTH=88 HEIGHT=31 ALT='$row[st_name]
In: $row[countin] | Out: $row[countout]' border='0' style='filter:alpha(opacity=50)' onMouseOver='nereidFade(this,100,60,15)' onMouseOut='nereidFade(this,50,75,15)'></a></div></td></tr>
<tr><td></td></tr></table></td>";
$bts = 0;
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
else{
echo "<td><table width='88' height='31' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'>
<tr><td bgcolor='#ffffff'><div align='center'><a href='inouteng.php?outid=$id' target='_blank'><IMG SRC='$row[st_button]' WIDTH=88 HEIGHT=31 ALT='$row[st_name]
In: $row[countin] | Out: $row[countout]' border='0' style='filter:alpha(opacity=50)' onMouseOver='nereidFade(this,100,60,15)' onMouseOut='nereidFade(this,50,75,15)'></a></div></td></tr>
<tr><td></td></tr></table></td>";
$bts++;
}
}
echo "</tr></table><tr><td><br>
<div align='center'><font color='#333333' size='1' face='Verdana, Arial, Helvetica, sans-serif'></font></div></td></tr></tr></td></table>";
mysql_close();
?>
upload till detta script
<?
$uploaddir = "/home/mikaelw/public_html/links/";
if(isset($Submit))
{
if(($HTTP_POST_FILES['imagefile']['type'] == "image/gif") || ($HTTP_POST_FILES['imagefile']['type'] == "image/.jpg")){
$file_realname = trim($HTTP_POST_FILES['imagefile']['name']);
move_uploaded_file($HTTP_POST_FILES['imagefile']['tmp_name'], $uploaddir . $file_realname)
or die ("<b><font color='#9CA1B4'>Ohhhhhhhhhhhhhh!</font></b><br>
I could not copy your button :(<br><br>
<font color='#EB7D05'>« </font><a href=\"javascript:history.go(-1)\">Lets try again!</a>");
include "tdata.php";
// -----------------
$sitebutton = "links/$file_realname";
mysql_query("insert into affillisteng (countout,countin,wm_name,wm_email,st_name,st_link,st_button) values ('0', '0', '$wmname', '$wmemail', '$sitename', '$sitelink', '$sitebutton')");
$result = mysql_query("SELECT * FROM affillisteng WHERE st_name='$sitename'");
$row = mysql_fetch_array($result);
$xis = "http://www.mikaelweb/inouteng.php?inid=";
echo "<b><font color='#9CA1B4'>Congratulations</font></b><br>
you´r now my partner :p<br><br>
Please download my button and use this url to link me:<br>
<font color='#9CA1B4'>$xis$row[id]</font><br><br>
<font color='#EB7D05'>« </font><a href=\"affiliates.php\">Lets see if i put your button correctly!</a>";
}
else{
echo "<b><font color='#9CA1B4'>Ohhhhhhhhhhhhhhhh!</font></b><br>
I could not copy your button :(<br>
Wrong Filetype (<font color='#9CA1B4'>".$HTTP_POST_FILES['imagefile']['name']."</font>)<br><br>
<font color='#EB7D05'>« </font><a href=\"javascript:history.go(-1)\">Lets try again!</a>";
}
}
?>
den del funkar bra nu men hur ska jag få den att maila mig med om det finns någon som har regga sig
<?
$uploaddir = "/home/mikaelw/public_html/links/";
if(isset($Submit))
{
if(($HTTP_POST_FILES['imagefile']['type'] == "image/gif") || ($HTTP_POST_FILES['imagefile']['type'] == "image/.jpg")){
$file_realname = trim($HTTP_POST_FILES['imagefile']['name']);
move_uploaded_file($HTTP_POST_FILES['imagefile']['tmp_name'], $uploaddir . $file_realname)
or die ("<b><font color='#9CA1B4'>Ohhhhhhhhhhhhhh!</font></b><br>
I could not copy your button :(<br><br>
<font color='#EB7D05'>« </font><a href=\"javascript:history.go(-1)\">Lets try again!</a>");
include "tdata.php";
// -----------------
$sitebutton = "links/$file_realname";
mysql_query("insert into affillisteng (countout,countin,wm_name,wm_email,st_name,st_link,st_button,status) values ('0', '0', '$wmname', '$wmemail', '$sitename', '$sitelink', '$sitebutton', '0')");
$result = mysql_query("SELECT * FROM affillisteng WHERE st_name='$sitename'");
$row = mysql_fetch_array($result);
$xis = "http://www.mikaelweb/inouteng.php?inid=";
echo "<p><b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Congratulations</font></b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
you´r now my partner :p</font></p>
<p><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Admin
will approve your site soon</font></b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
your button will not be on the site before that</font><br>
<br>
Please download my button and use this url to link me:<br>
$xis$row[id]<br>
<br>
+ <a href=\"affiliates.php\">Lets see if i put your button correctly!</a>";
} else{ echo "<b>Ohhhhhhhhhhhhhhhh!</b><br>
I could not copy your button :(<br>
Wrong Filetype (".$HTTP_POST_FILES['imagefile']['name'].")<br>
<br>
+ <a href=\"javascript:history.go(-1)\">Lets try again!</a></font>></p>";
}
}
?>
ska den vara på detta fil ????
samt hur kan man byta namn på filerna om namnet blit nisse ska den bli 01 02 03 04 05 och så vidare
Exakt vad vill du döpa om till? Ska dom kunna ladda upp mer än 1 bild?
Om dom ska kunna ladda upp endast en bild så är det enklast att döpa bilden till $sitename eller nåt sånt.
<?
$uploaddir = "/home/mikaelw/public_html/links/";
if(isset($Submit))
{
if(($HTTP_POST_FILES['imagefile']['type'] == "image/gif") || ($HTTP_POST_FILES['imagefile']['type'] == "image/.jpg")){
$file_realname = trim($HTTP_POST_FILES['imagefile']['name']);
move_uploaded_file($HTTP_POST_FILES['imagefile']['tmp_name'], $uploaddir . $file_realname)
or die ("<b><font color='#9CA1B4'>Ohhhhhhhhhhhhhh!</font></b><br>
I could not copy your button :(<br><br>
<font color='#EB7D05'>« </font><a href=\"javascript:history.go(-1)\">Lets try again!</a>");
include "tdata.php";
// -----------------
$sitebutton = "links/$file_realname";
mysql_query("insert into affillisteng (countout,countin,wm_name,wm_email,st_name,st_link,st_button,status) values ('0', '0', '$wmname', '$wmemail', '$sitename', '$sitelink', '$sitebutton', '0')");
$result = mysql_query("SELECT * FROM affillisteng WHERE st_name='$sitename'");
$row = mysql_fetch_array($result);
$xis = "http://www.mikaelweb/inouteng.php?inid=";
mail("webmaster@mikaelweb.com.com", "Ny affiliate", "st_name\st_link\wm_email");
echo "<p><b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Congratulations</font></b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
you´r now my partner :p</font></p>
<p><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Admin
will approve your site soon</font></b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
your button will not be on the site before that</font><br>
<br>
Please download my button and use this url to link me:<br>
$xis$row[id]<br>
<br>
+ <a href=\"affiliates.php\">Lets see if i put your button correctly!</a>";
} else{ echo "<b>Ohhhhhhhhhhhhhhhh!</b><br>
I could not copy your button :(<br>
Wrong Filetype (".$HTTP_POST_FILES['imagefile']['name'].")<br>
<br>
+ <a href=\"javascript:history.go(-1)\">Lets try again!</a></font></p>";
}
}
?>
måste kunna byta namn på filen on det finns en redan med samma namn
samt detta med mail så man ser vilken site address med mera
<?
$uploaddir = "/home/mikaelw/public_html/links/";
if(isset($Submit))
{
if(($HTTP_POST_FILES['imagefile']['type'] == "image/gif") || ($HTTP_POST_FILES['imagefile']['type'] == "image/.jpg")){
$file_realname = trim($HTTP_POST_FILES['imagefile']['name']);
move_uploaded_file($HTTP_POST_FILES['imagefile']['tmp_name'], $uploaddir . $file_realname)
or die ("<b><font color='#9CA1B4'>Ohhhhhhhhhhhhhh!</font></b><br>
I could not copy your button :(<br><br>
<font color='#EB7D05'>« </font><a href=\"javascript:history.go(-1)\">Lets try again!</a>");
include "tdata.php";
// -----------------
$sitebutton = "links/$file_realname";
mysql_query("insert into affillisteng (countout,countin,wm_name,wm_email,st_name,st_link,st_button,status) values ('0', '0', '$wmname', '$wmemail', '$sitename', '$sitelink', '$sitebutton', '0')");
$result = mysql_query("SELECT * FROM affillisteng WHERE st_name='$sitename'");
$row = mysql_fetch_array($result);
$xis = "http://www.mikaelweb/inouteng.php?inid=";
mail("webmaster@mikaelweb.com", "New affiliate at international", "Login to admin panel and put status 1 to this site or delete this site if you don´t like it");
echo "<p><b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Congratulations</font></b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
you´r now my partner :p</font></p>
<p><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Admin
will approve your site soon</font></b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
your button will not be on the site before that</font><br>
<br>
Please download my button and use this url to link me:<br>
$xis$row[id]<br>
<br>
+ <a href=\"affiliates.php\">Lets see if i put your button correctly!</a>";
} else{ echo "<b>Ohhhhhhhhhhhhhhhh!</b><br>
I could not copy your button :(<br>
Wrong Filetype (".$HTTP_POST_FILES['imagefile']['name'].")<br>
<br>
+ <a href=\"javascript:history.go(-1)\">Lets try again!</a></font></p>";
}
}
?>
mail("webmaster@mikaelweb.com", "New affiliate at international", "".$row['sitename']." want to become a affiliate.\n\nLogin to admin panel and put status 1 to this site or delete this site if you don´t like it\nhttp://www.mikaelweb.com/adminpanel.php?id=".$row['id']."", "From: [email]webmaster@mikaelweb.com[/email]");
För att kolla om filen redan finns använder du
if (file_exists($uploaddir.$HTTP_POST_FILES['imagefile']['name']))
Ska de kunna ha flera bilder eller bara en?
Om det bara är en så behöver du ju inte kolla om det redan finns en, eftersom den kommer ersättas av den nya bilden. Men då måste du döpa den till något relaterat till affiliaten, t.ex $id.
<?
// This is your upload dir.
$uploaddir = "/home/mikaelw/public_html/links/";
if(isset($Submit))
{ // This is your upload funtion.
if(($HTTP_POST_FILES['imagefile']['type'] == "image/gif") || ($HTTP_POST_FILES['imagefile']['type'] == "image/.jpg")){
$file_realname = trim($HTTP_POST_FILES['imagefile']['name']);
include "tdata.php";
// -----------------
mysql_query("insert into affillisteng (countout,countin,wm_name,wm_email,st_name,st_link,status) values ('0', '0', '$wmname', '$wmemail', '$sitename', '$sitelink', '0')");
$result = mysql_query("SELECT * FROM affillisteng WHERE st_name='$sitename'");
$row = mysql_fetch_array($result);
move_uploaded_file($HTTP_POST_FILES['imagefile']['tmp_name'], $uploaddir . $row['id']) or die ("<b><font color='#9CA1B4'>Ohhhhhhhhhhhhhh!</font></b><br> I could not copy your button <img src="images/wfstandard/smilies/frown.gif" border="0" alt=""><br><br><font color='#EB7D05'>« </font><a href=\"java script:history.go(-1)\">Lets try again!</a>");
$xis = "http://www.mikaelweb/inout.php?inid=";
// This will e-mail to you when ther is new affiliate on your site.
mail("webmaster@mikaelweb.com", "New affiliate", "".$row['sitename']." want to become a affiliate.\n\nLogin to admin panel and put status 1 to this site or delete this site if you don´t like it\nhttp://www.mikaelweb.com/adminpanel.php?id=".$row['id']."", "From: [email]webmaster@mikaelweb.com[/email]");
// This will display if your file is uploaded .
echo "<p><b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Congratulations</font></b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
you´r now my partner <img src='shoutbox/smileys/tongue.gif' border='0' alt=''></font></p>
<p><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Admin
will approve your site soon</font></b><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'><br>
your button will not be on the site before that</font><br>
<br>
Please download my button and use this url to link me:<br>
$xis$row[id]<br>
<br>
+ <a href=\"affiliateswe.php\">Lets see if i put your button correctly!</a>";
// This will display if your file is Not uploaded.
} else{ echo "<b>Ohhhhhhhhhhhhhhhh!</b><br>
I could not copy your button <img src='shoutbox/smileys/frown.gif' border='0' alt=''><br>
Wrong Filetype (".$HTTP_POST_FILES['imagefile']['name'].")<br>
<br>
}
}
?>
move_uploaded_file($HTTP_POST_FILES['imagefile']['tmp_name'], $uploaddir . $row['id']) or die ("<b><font color='#9CA1B4'>Ohhhhhhhhhhhhhh!</font></b><br> I could not copy your button <img src="images/wfstandard/smilies/frown.gif" border="0" alt=""><br><br><font color='#EB7D05'>« </font><a href=\"java script:history.go(-1)\">Lets try again!</a>");