Jump to content




Free website hosts with built-in webpages


  • You cannot reply to this topic
14 replies to this topic

#1 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 06 February 2013 - 06:10 PM

Hey guys, I'm looking for a free website host that at least has the following:

Login system / or some kind of anonymous commenting ( to add links )
Has it's own webpages for me to edit
Has a 'link' page that is able to take links with name, url, description.

I can't find any after googling :huh:

#2 Dlcruz129

    What's a Lua?

  • Members
  • 1,423 posts

Posted 06 February 2013 - 06:23 PM

You could use 000webhost.com. I think Wordpress would be best for the actual web page stuff. .

#3 tesla1889

  • Members
  • 351 posts
  • LocationSt. Petersburg

Posted 06 February 2013 - 06:29 PM

000webhost is great, as long as you have HTML and/or PHP knowledge

#4 Dlcruz129

    What's a Lua?

  • Members
  • 1,423 posts

Posted 06 February 2013 - 06:41 PM

View Posttesla1889, on 06 February 2013 - 06:29 PM, said:

000webhost is great, as long as you have HTML and/or PHP knowledge

Or just upload something like Wordpress.

#5 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 06 February 2013 - 10:02 PM

Hmmm, okay, I'll check it out later when I'm at home.

Does it allow registration/login or not? Can people (anyone) post things (links/pictures) onto the website?

#6 Dlcruz129

    What's a Lua?

  • Members
  • 1,423 posts

Posted 07 February 2013 - 04:29 AM

View PostremiX, on 06 February 2013 - 10:02 PM, said:

Hmmm, okay, I'll check it out later when I'm at home.

Does it allow registration/login or not? Can people (anyone) post things (links/pictures) onto the website?

It's a blogging system. You can make pages, people can comment, etc.

#7 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 07 February 2013 - 04:45 AM

Yeah, figured :P

I'm trying to figure out how to make it able for users to add a link to a page that then is saved to a Database.
And then get the information from that database using ComputerCraft.

Can this be done?

#8 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 07 February 2013 - 04:48 AM

yea, you have to use PHP and the HTTP api

#9 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 07 February 2013 - 04:59 AM

View PostPixelToast, on 07 February 2013 - 04:48 AM, said:

yea, you have to use PHP and the HTTP api

Yes, I know that.

I know a little about PHP and MySQL but I have no clue how I would use the HTTP api to extract information from the MySQL table.

#10 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 07 February 2013 - 05:06 AM

Well, as long as the information is in plain text, you can pull the info directly from the server using http.get, or get a response using http.request. You can have the server respond to certain requests with the information you want using PHP. I don't know how to do it server side, but the HTTP api is fairly straight forward.

#11 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 07 February 2013 - 05:22 AM

Go to http://w3schools.com for some PHP and MySQL tutorials. Just have a PHP script extract data from a MySQL database depending on the variables you pass via the http.get function.

#12 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 07 February 2013 - 05:40 AM

But is this possible with 000webhost websites? The extracting of MySQL tables. Not sure if I can make my own PHP script.

Could anyone give me an example of how extracting the information would work.

#13 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 07 February 2013 - 06:41 AM

You quarry the data from the database and echo it.

#14 zekesonxx

  • Signature Abuser
  • 263 posts
  • LocationWhere you aren't

Posted 07 February 2013 - 08:11 AM

<?php
//Who wants to bet this won't highlight correctly?
mysql_connect("localhost", "YOURMYSQLUSERNAME", "YOURMYSQLPASSWORD");
$query = mysql_query("SELECT * FROM YOURTABLEHERE");
echo json_encode(mysql_fetch_assoc($query));
//Really, you should be using PDO and perpared statements. I'm not typing that out, and I doubt 000WH has support for it.
?>

--You will need a pure-Lua JSON decoder. There are a few of these floating around.
print("Now fetching data from website")
result = http.get("LINKTOYOURPHPSCRIPT").readAll()
if result ~= "" then
results = json.decode(result)
else
print("Unable to fetch data from website")
end


#15 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 07 February 2013 - 08:34 AM

Yeah I got it with this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">

	<head>
		<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
		<title>Database Info</title>
	</head>

	<body>
		<h2>Information in the database</h2>
		<?php 
			// Connects to your Database 
			mysql_connect("xxxx", "xxxx", "xxxx") or die(mysql_error()); 
			mysql_select_db("xxxx") or die(mysql_error()); 
			$data = mysql_query("SELECT * FROM xxxx") or die(mysql_error());
			Print "\n<!-- Start of Table -->\n";
			Print "<table border=1 cellpadding=15>\n";
			Print "\n<!-- First row (Headings) -->\n";
			Print "<tr>\n";
			Print "    <th>ID</th>\n";
			Print "    <th>User</th>\n";
			Print "    <th>Title</th>\n";
			Print "    <th>URL</th>\n";
			Print "    <th>Description</th> \n";
			Print "    <th>Post Date</th> \n";
			Print "</tr> \n";
			while($info = mysql_fetch_array( $data )) 
				{
					Print "<!-- ID NO. <ID>".$info['id']."</ID> -->\n";
					Print "<!-- USER <USER>".$info['user']."</USER> -->\n";
					Print "<!-- VIDEO_TITLE <TITLE>".$info['video_name']."</TITLE> -->\n";
					Print "<!-- VIDEO_URL <URL>".$info['video_url']."</URL> -->\n";
					Print "<!-- VIDEO_DESCRIPTION <DESC>".$info['video_desc']."</DESC> -->\n";
					Print "<!-- VIDEO_TIMESTAMP <POSTDATE>".$info['video_timestamp']."</POSTDATE> -->\n";
					Print "<tr>\n"; 
					Print "    <td>".$info['id']."</td>\n";
					Print "    <td>".$info['user']."</td>\n";
					Print "    <td>".$info['video_name']."</td>\n";
					Print "    <td>".$info['video_url']."</td>\n";
					Print "    <td>".$info['video_desc']."</td>\n";
					Print "    <td>".$info['video_timestamp']."</td>\n";
					Print "</tr>\n";
				}
			Print "<!-- End of Table -->\n";
			Print "</table>\n"; 
		?> 
	</body>
</html>		

Works brilliantly. Thanks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users