Jump to content

Can anybody help me?


shaunbaird

Recommended Posts

Hi, I bought a paid to click script, only to find theres no user guide and the programmers contact email no longer exists.  The site I purchased form hasn't got back to me.
I've managed to ftp upload and install the site myself, but there seems to be a bug.

Members can submit paid links, and paid banners.

The links seems to work ok, but the banners module is producing an error when I try to upload a banner from my own computer, I get the following error message on the website:

[b]Warning: copy(/home/wwwsmon/public_html //images/banners/mentor~someinfo4u-banner-simple.gif): failed to open stream: No such file or directory in /home/wwwsmon/public_html/link_acco_ban2.php on line 55[/b]

and the following error message in the middle of the screen:


[b]Internal Server Error: Could not upload file.
/home/wwwsmon/public_html //images/banners/mentor~someinfo4u-banner-simple.gif[/b]


I have also pasted below the contents of the file called link_acco_ban2.php where the error message is reported above:

If anybody wishes to help me - I would be grateful.

Thanks
Shaun Baird
www.somemoney4u.info


<?
include('includes/data_conn.php');
session_start();

$get_general = mysql_query("SElECT * FROM main");
$grow = mysql_fetch_array($get_general);
$g_genid = $grow[genid];
$g_title = $grow[title];
$g_baseurl = $grow[baseurl];
$g_rooturl = $grow[rooturl];
$g_aemail = $grow[adminemail];
$g_pemail = $grow[paypalemail];
$g_lcharge = $grow[linkcharge];
$g_bcharge = $grow[bannercharge];
$g_withdraw = $grow[withdraw];
$g_bold = $grow[bold];
$g_italic = $grow[italic];
$g_referral = $grow[referral];

if ($HTTP_SESSION_VARS[aduser])
{
if ($newtitle && $url && $banner)
{
if ($banner == "none")
{
include('includes/header.php');
echo "<div class=\"contex\">Error: No File Uploaded.</div>";
include('includes/footer.php');
exit;
}
if ($banner_size == 0)
{
include('includes/header.php');
echo "<div class=\"contex\">Error: File size is 0 bytes</div>";
include('includes/footer.php');
exit;
}
if (!is_uploaded_file($banner))
{
include('includes/header.php');
echo "<div class=\"contex\">Error: Possible file upload attack.</div>";
include('includes/footer.php');
exit;
}
$good_file = substr($banner_name, -4);
if ($good_file != ".gif" && $good_file != ".jpg")
{
include('includes/header.php');
echo "<div class=\"contex\">Error: You must upload a GIF or a JPEG for a banner.</div>";
include('includes/footer.php');
exit;
}
$mod_file = "$aduser~$banner_name";
$upfile = "$g_rooturl/images/banners/".$mod_file;
if (!copy($banner, $upfile))
{
include('includes/header.php');
echo "<div class=\"contex\">Internal Server Error: Could not upload file.</div>";
echo $upfile;
include('includes/footer.php');
exit;
}
$check_url = substr($url, 0, 7);
if ($check_url == 'http://')
{
$url = strrev($url);
$url = substr($url, 0, -7);
$url = strrev($url);
}
$date = date("n/j/Y");
if ($insert_bannerdb = mysql_query("INSERT INTO n_ban (banid, username, title, banname, date, status, addr) VALUES (NULL, '$aduser', '$newtitle', '$mod_file', '$date', 'inactive', '$url')"))
{
$ban_id = mysql_insert_id();
if ($HTTP_SESSION_VARS[ban_id])
{
session_unregister("ban_id");
}
$ban_id = mysql_insert_id();
session_register("ban_id");
include('includes/header.php');
echo "<div class=\"contex\"><div class=\"heatexblu\">You're Not Done Yet!</div>Your banner will not be added until you pay a fee of $g_bcharge via PayPal.<br /><br />You may do so by clicking the button below.<br /><br />";
}
else
{
include('includes/header.php');
echo "aduser: $aduser, newtitle: $newtitle, date: $date, mod_file: $mod_file";
echo "<div class=\"contex\"><div class=\"heatexblu\">Error!</div>An unknown error occurred while processing your request.<br /><br />If the problem persists, please <a href=\"contact.php\" class=\"acon\">contact</a> the system administrator.<br /><br />";
}
}
else
{
include('includes/header.php');
echo "<div class=\"contex\"><div class=\"heatexblu\">Error!</div>You did not provide a value for all of the fields.<br /><br />Please click back in your browser and try again.<br /><br />";
}
}
?>

</div>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<? echo "$g_pemail"; ?>">
<input type="hidden" name="item_name" value="Add New Banner">
<input type="hidden" name="amount" value="<? echo "$g_bcharge"; ?>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="<? echo "$g_baseurl"; ?>link_acco_ban3.php">
<input type="hidden" name="cancel_return" value="<? echo "$g_baseurl"; ?>link_acco_canc.php">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypal.com/images/x-click-but23.gif" border="0" name="submit" alt="Make Payment!">
</form>

<? include('includes/footer.php'); ?>


Link to comment
https://forums.phpfreaks.com/topic/19239-can-anybody-help-me/
Share on other sites

The only think I can see that might be an issue is this line....

  $upfile = "$g_rooturl/images/banners/".$mod_file;

you see in the error message you get '//images'... the '//' may be the issue.

change the line above to

  $upfile = $g_rooturl . "images/banners/" . $mod_file;

see if that helps.
Link to comment
https://forums.phpfreaks.com/topic/19239-can-anybody-help-me/#findComment-83388
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.