How To Create A Free Web Host

Reply

Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: How To Create A Free Web Host

 
0
  #11
Sep 5th, 2005
Hi Zippee,

First, thanks for all your help. Second, I was wrong about knowing how to upload files! Do you know how? I already made a form with a file field.

Thanks again.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: How To Create A Free Web Host

 
0
  #12
Sep 5th, 2005
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: How To Create A Free Web Host

 
0
  #13
Sep 5th, 2005
Hi Zippee!

Thanks! I get some errors so I attached the code:
login.php:
[PHP]
<!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>CinnaHost Login</title>
</head>

<body bgcolor="#3366FF">
<img src="logo.png" width="939" height="61" />
<br />
<table width="940" height="215" border="1">
<tr>
<td width="103" height="209"><center>
<h3>CinnaHost<br />
<br />
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="20">
<param name="BGCOLOR" value="#3366FF" />
<param name="movie" value="button1.swf" />
<param name="quality" value="high" />
<embed src="button1.swf" width="100" height="20" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#3366FF" ></embed>
</object>
<br />
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="20">
<param name="BGCOLOR" value="#3366FF" />
<param name="movie" value="button4.swf" />
<param name="quality" value="high" />
<embed src="button4.swf" width="100" height="20" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#3366FF" ></embed>
</object>
<br />
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="20">
<param name="BGCOLOR" value="#3366FF" />
<param name="movie" value="button2.swf" />
<param name="quality" value="high" />
<embed src="button2.swf" width="100" height="20" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#3366FF" ></embed>
</object>
<br />
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="20">
<param name="BGCOLOR" value="#3366FF" />
<param name="movie" value="button3.swf" />
<param name="quality" value="high" />
<embed src="button3.swf" width="100" height="20" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#3366FF" ></embed>
</object>
<br />
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="20">
<param name="BGCOLOR" value="#3366FF" />
<param name="movie" value="button5.swf" />
<param name="quality" value="high" />
<embed src="button5.swf" width="100" height="20" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#3366FF" ></embed>
</object>
</h3>
</center></td>
<td width="821" bgcolor="#0000FF"><center>
<h2>CinnaHost Login/Upload:</h2>
</center>
<form action="in.php" method="post" enctype="multipart/form-data">
<p><strong> <font color="#FFFFFF">Site Name:</font><br />
<input name="site" type="text" />
<br />
<br />
<font color="#FFFFFF">Password:</font><br />
<input type="password" name="password" />
</strong><strong></strong>
<strong> <br />
<br />
<font color="#FFFFFF">File To Upload:</font>
<br />
<input type="file" name="updelfile" />
<br />
<br />

<input type="submit" value="Login" />
</strong></p>
</form></td>
</tr>
</table>
</body>
</html>
[/PHP]

in.php:
[PHP]<html>
<head>
<title>CinnaHost Login</title>
</head>
<body bgcolor="#3366FF">
<center><h1><font color="#FFFFFF">Uploading...</font></h1>
<h2><font color="#FFFFFF">To Upload More Files, Click <a href="login.php"><font color="#FFFFFF">Here</font></a>.</font></h2>
</h1></center>


<?php
$filename = "../public/$_POST[site]/pswrd.pswrd";
$fp = fopen($filename,"r") or die ("Login Not Working - please try again.");
$pswrd = fgets($fp);
$attempt = "$_POST[password]";
if($pswrd == $attempt) {
echo "Login Successful!";


//START UPLOAD

$file = $_FILES["$_POST[updelfile]"];
// set the file type you will allow to avoid abuse to your server
$accept = array('pdf','doc','xls','ppt','txt','zip','jar','html','html','php','rtf','jpg','png','gif','txt','java','cpp');
if($file["size"] > 0) {
$file_name = basename($file["name"]);
$ext = substr($file_name, -3, 3);
}
// validate file
if ($file["size"] > 5000000) {
echo "Filesize over 5 mb limit.<br>\n";
}
elseif(!in_array($ext, $accept)) {
echo "Invalid file format. <br>\n";
}
else {
// set folder path to which image uploaded
$uploaddir = "../public/$_POST[site]";
//copy the file to some permanent location
if (move_uploaded_file($file['tmp_name'], $uploaddir.$file['name'])) {
echo "File has been uploaded.<br>\n";
}

//END UPLOAD


else {
echo "Error found. Please try again. <br>\n";
}
}
}
else {
echo "Login Failed - please try agin.";
}
?>

</body>
</html>[/PHP]

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: How To Create A Free Web Host

 
0
  #14
Sep 5th, 2005
What errors you get?

You may want to use echo or print at each stage to find out where the errors were. I would suspect your $filename may be an error and always use $_POST['something'].
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 350
Reputation: Ghost is an unknown quantity at this point 
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: How To Create A Free Web Host

 
0
  #15
Sep 6th, 2005
actually, $filename works. Here's the errors:
[PHP]
Notice: Undefined index: updelfile in c:\phpdev5\www\public\in.php on line 22

Notice: Undefined index: in c:\phpdev5\www\public\in.php on line 22

Notice: Undefined variable: ext in c:\phpdev5\www\public\in.php on line 33
Invalid file format.
[/PHP]

If you want to view the page, go to http://192.168.1.42/public/login.php You can use "cinnatech" for a site name and "pwrd" for the password. If you try to upload a file and click login, you'll see the error messages.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: How To Create A Free Web Host

 
0
  #16
Sep 6th, 2005
I can't access the site as 192 is your localhost address, not the true IP address.
I have no idea about the first two. The thrid may be because you upload files that wasn't define in the script (in my other post http://www.daniweb.com/techtalkforums/thread31803.html there is something called $accept that prevent undefined file being upload).
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 1
Reputation: Speedy505 is an unknown quantity at this point 
Solved Threads: 0
Speedy505 Speedy505 is offline Offline
Newbie Poster

Re: How To Create A Free Web Host

 
0
  #17
Apr 21st, 2009
Hey zipee can you help me how to create a free webhost i need my site to create game its called Star Wars Jedi Academy.My friend from that game tell im just must go to game an create game but there is no ip adress or how to call my server so can you please help me...i wait your answer.....
Tnxy
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 1
Reputation: dairishguy is an unknown quantity at this point 
Solved Threads: 0
dairishguy dairishguy is offline Offline
Newbie Poster

Re: How To Create A Free Web Host

 
0
  #18
Apr 26th, 2009
You Can Try joining http://www.myownfreehost.net
im a Member and i Can Host Unlimited Sites,
its Free {but theres also Paid Host if ya Wanna pay a Bit}


P.S There is Plenty of Features and you can have no Banners or Adds {or Add Some if you want}
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 12
Reputation: foryounow is an unknown quantity at this point 
Solved Threads: 1
foryounow foryounow is offline Offline
Newbie Poster

Re: How To Create A Free Web Host

 
0
  #19
Apr 27th, 2009
We are talking about how to create a free webhost service , not looking for a free webhost, thanks anyway.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC