PDA

View Full Version : PHP on iWeb '08




JelvisChan
Jan 11, 2009, 06:03 AM
IWeb / PHP Help!!

Does anyone know a way to use php on iWeb '08?

Here are the codes I am trying to process:

HTML:


<form method="post" action="contact.php">
Email: <input name="email" type="text"><br>
Message:<br>
<textarea name="message" rows="15" cols="40"></textarea><br>
<input type="submit">
</form>

-and-

PHP:

<?php
$to = "you@yoursite.com";
$subject = "Join Us";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>

How, on iWeb, is there a way so that I can put the HTML inside a snippet, and when you click submit query, it redirects to the thank you, good job, or whatever page? This would be EXTREMELY helpful!

Help if you can! Thanks.



angelwatt
Jan 11, 2009, 08:09 AM
You would add the form as a HTML Snippet. Then the PHP would be its own page, and wouldn't look like your other iWeb pages. Also, PHP isn't on MobileMe so you'll be able to do this if your site is hosted on a server that has PHP support.

Also, if you figure things out, you should really look at pre-built contact forms. In its current for, the PHP you have their will easily be taken over by a spammer and turn your web site into spam host essentially. This can lead to your web site being pulled off the internet because it becomes a nuisance to businesses. What your script lacks is sanitizing the text being sent from the form. There are some tutorials that will teach you how to properly check input for malicious intent, but people have already created nice scripts for doing all this, so I recommend doing some searches for some.

JelvisChan
Jan 11, 2009, 09:55 AM
You would add the form as a HTML Snippet. Then the PHP would be its own page, and wouldn't look like your other iWeb pages. Also, PHP isn't on MobileMe so you'll be able to do this if your site is hosted on a server that has PHP support.

Also, if you figure things out, you should really look at pre-built contact forms. In its current for, the PHP you have their will easily be taken over by a spammer and turn your web site into spam host essentially. This can lead to your web site being pulled off the internet because it becomes a nuisance to businesses. What your script lacks is sanitizing the text being sent from the form. There are some tutorials that will teach you how to properly check input for malicious intent, but people have already created nice scripts for doing all this, so I recommend doing some searches for some.


Okay, this is what I have done in relation to your help:

I have put the html code into a snippet and then I put the PHP code into my computer's suer's sites folder -- which I turned on php for.

I named it sendmail.php.

On the html snippet, this action says: http://Jelvis/~jelvischan1/sendmail.php . <-- jelvischan1 is my computer's username

I tried the form on my dad's and sister's computer, and they both say that the link cannot be found.

I double-checked both URLs. Can other machines see my personal website on Web Sharing ( System Preferences )?

Is there a way to do this? If so, can you tell me the steps?

angelwatt
Jan 11, 2009, 10:48 AM
If they other computers are hooked to your network then they'll access your computer through your IP address. Some thing along the lines of http://198.162.1.101/~jelvischan1/ and that should take them to your home page. Also make sure you have web sharing turned on in System Preferences. That's also where it should tell you the IP address to connect through.

JelvisChan
Jan 11, 2009, 11:05 AM
Is there a way to make that website universal so that I can use the action part of the html form to link to that and process the form other than only the people on my local network being able to process the form?

angelwatt
Jan 11, 2009, 11:15 AM
Is there a way to make that website universal so that I can use the action part of the html form to link to that and process the form other than only the people on my local network being able to process the form?

You'll need to configure your home router to forward port 80 to your machine's IP address. Then other people will enter the IP address of your router to access your site. This also means any time your router's IP address changes (anywhere between a day or a few months) people will have to enter the new IP to see your site. There are some services like DynDNS that help remedy this to an extent, but otherwise you would want to get a web host so you don't have to make such modifications and you could also get a domain name so they don't have to enter the IP address.

JelvisChan
Jan 11, 2009, 11:24 AM
How do I forward port 80 to my ip address?

angelwatt
Jan 11, 2009, 11:39 AM
How do I forward port 80 to my ip address?

Depends on your router. See it's manual.

JelvisChan
Jan 11, 2009, 03:09 PM
Depends on your router. See it's manual.

Is there an easier way to do this because I am only 13.

I really just want to make my /users/sites folder universal without too much preparation.

Can't I just add them somewhere so that they just put a URL into the address bar and it loads, or is that too complicated?

I just need it so that when you click "Submit" on a form, it redirects you to a thank you page and the data sent is to my email address. I know how to do that -- the codes and scripts, but I don't know how to make it so that anybody can submit it, not just someone in my local network.

I tried putting the php script into my iWeb folders at me.com, but this is not a PHP enabled server, that is what Web Sharing is for, but only for my local network. Making this universal is what I need to do, but may need some work to be done.

Easy way to do this?
Fill Free to Share your ideas anyone!

angelwatt
Jan 11, 2009, 04:12 PM
I already told you the easy way. It's something that takes maybe a minute to do. I can't tell you how to configure your router though because I don't know what kind you have or how it's currently setup. Otherwise, have your parents buy you some web space. There are some free options for hosting as well if you search around, but a domain name will cost money.

JelvisChan
Jan 12, 2009, 12:26 AM
I have plenty of web space on iWeb -- about 5.0 GB
I can buy a domain name, but will that automatically go to my users/sites pages if people type the new domain in?

If so, what is the best/cheapest place to buy a domain name? Yahoo?
If there is a free way to do this, that would be better because I really don't have a lot of money, and, if I am correct, I have to pay by the month.

angelwatt
Jan 12, 2009, 09:04 AM
I have plenty of web space on iWeb -- about 5.0 GB
I can buy a domain name, but will that automatically go to my users/sites pages if people type the new domain in?

If so, what is the best/cheapest place to buy a domain name? Yahoo?
If there is a free way to do this, that would be better because I really don't have a lot of money, and, if I am correct, I have to pay by the month.

Well, iWeb doesn't have that much space, MobileMe does. You can generally buy a domain name for under $10 a year (paid a year at a time), pretty cheap. Just search around for the best deal and be sure to read the fine print. The free alternative would be the DynDNS (http://www.dyndns.com/services/dns/dyndns/) that I mentioned before. With just the domain name you'll have to point it at your router IP address, which changes from time-to-time (and thus you'l have to watch out for when it changes so you can manually change the IP address fot the domain name), but with DynDNS it knows when the IP changes and makes the adjustments for you.

JelvisChan
Jan 12, 2009, 10:35 AM
I made an account on DynDNS, and I put my ip address into the host page.
Once you type the IP in and save, the link will take you to the pages at /Macintosh HD/Library/Webserver/Documents, right?

Also, is the link now universal?
How do I link it to my Users/Sites folder rather than to the Webserver/Documents?

notjustjay
Jan 12, 2009, 10:43 AM
Is there an easier way to do this because I am only 13.

I really just want to make my /users/sites folder universal without too much preparation.



First, the internet doesn't discriminate based on age. Whether you're 13 or 103, setting up a web site takes the same effort. Second, your age isn't an excuse. I know lots of kids who are as much of a tech nerd, or even more so, than me. :)

Edit: ok, wow, you figured it out while I was typing that great huge post.

I made an account on DynDNS, and I put my ip address into the host page.
Once you type the IP in and save, the link will take you to the pages at /Macintosh HD/Library/Webserver/Documents, right?

Also, is the link now universal?
How do I link it to my Users/Sites folder rather than to the Webserver/Documents?

The link is now "universal" yes. To get it to your Users/Sites folder, you type in the full link, e.g.

http://jelvischan.dyndns.org/~jelvis/

Or you could insert a quick HTTP redirect in the Webserver/Documents folder.

JelvisChan
Jan 12, 2009, 11:22 AM
Some people's brains aren't able to take in all of the web scripting/processing like older people do because of experience.


I just took online tutorials about a year ago on HTML and Javascript, so sorry if I bothered you.

I tested the link on my machine, please test it on yours to see if you get the default index.html link on your mac. Here is the link:

http://lost.webhop.net/~jelvischan1

I am going to change it later because I think it is a gay URL :)

Hope it works, and thanks for all the help everyone!!

notjustjay
Jan 12, 2009, 11:40 AM
Some people's brains aren't able to take in all of the web scripting/processing like older people do because of experience.


I just took online tutorials about a year ago on HTML and Javascript, so sorry if I bothered you.

No bother. And my post wasn't meant to be condescending. I spent over half an hour typing up a long post about the basics of hosting and DynDNS and when I submitted the post, you had already figured all of that out. I don't think you're giving yourself enough credit.

I tried the link you provided on my PC at work, and it didn't load, but I will try again on my Mac at home.

angelwatt
Jan 12, 2009, 11:46 AM
I tested the link on my machine, please test it on yours to see if you get the default index.html link on your mac. Here is the link:

http://lost.webhop.net/~jelvischan1

It didn't load for me either. Were you able to forward port 80 on your router to your computer? That step is still required if not.

JelvisChan
Jan 12, 2009, 11:57 AM
No, I am still not sure how to do that.

All I did was go to that website - DynDLS -- and made an account and then put in the host link with my computer's IP Address.

I click save changes and I tested the link : http://lost.webhop.net/~jelvischan1

It works for me and my dad's machine, but this could be only for my local network.

I am really perplexed when it comes to forward port 80, and I really don't want to mess with the internet modem. Is that the only way?!? I was soooo close.

angelwatt
Jan 12, 2009, 12:35 PM
No, I am still not sure how to do that.

Yes it is definitely a required step, ans as I have said the steps to do it depend on the router itself. Can you look at it and find out the make and model? Most have manuals online, so we may be able to help if we know what type it is. Also be sure to get this information from the router, not the cable modem, unless they are one in the same. I think some companies have them together now.

The steps are generally speaking,

Go to URL 198.162.1.0 (or some variant)
Click on networking / forwarding page
Specify your IP
Specify port number
Save and apply
Restart router

notjustjay
Jan 12, 2009, 12:42 PM
I click save changes and I tested the link : http://lost.webhop.net/~jelvischan1

It works for me and my dad's machine, but this could be only for my local network.

I am really perplexed when it comes to forward port 80, and I really don't want to mess with the internet modem. Is that the only way?!? I was soooo close.

Yes, this is the only way to get web traffic onto your computer from outside your home network.

What's happening is that your DynDNS account is set up correctly, so when I access your DynDNS weblink (lost.webhop.net), the DynDNS server gives me the IP address which your router is using to connect to the internet. So we're knocking on your door, in a virtual sense, and awaiting an answer...

But your router is also a firewall, and by default it is set to ignore all incoming requests. So our browsers sit, requesting, and hear nothing back. Your browser, and your dad's browser, work because the router is smart enough to see that they're both already inside the firewall.

By forwarding port 80 you are telling your router "it's ok, I'm expecting people to send incoming web requests, because I'm running a web server on one of my computers, and here is where you should send those requests to. Please continue to block everything else, but allow web requests to come in."

It's like telling everyone your address to come visit you, but the security guard at the door is refusing to answer the door when people knock. You have to tell the guard that you're expecting certain people, and when they knock, please escort them to the right room in your house.

The only other way to do this is to buy a web hosting package, one that lets you run PHP scripts, and run everything off one of their servers. (99% of web hosts provide PHP -- unfortunately iWeb/MobileMe falls into the 1% that don't). You upload your script to their server, link to their server, and let them take care of it. This way nobody even has to know anything about where your computer lives on the 'net. Of course, this does cost money, all the way from "free" (usually with catches, like ads) to between $3-30 per month. Personally I'm a fan of DreamHost.

notjustjay
Jan 12, 2009, 12:59 PM
I'll complete this analogy to complete the picture for anyone reading this thread who might find it useful.

Running a web server on one of my computers is like setting up a lemonade stand in my room. People inside my house know that they can go to "Jay's Room" and buy lemonade, and life is good.

But now I want people from my neighborhood to be able to buy lemonade too. I can't put up a poster that says "lemonade - come to Jay's room", because nobody outside my house knows what that is. I can, however, put up a poster that says "lemonade - come to 123 Main Street". Let's say I also register a company name, Super Lemonade, and put a listing in the phone book that directs anyone searching for "Super Lemonade" to "123 Main Street".

(This is the equivalent of registering a domain name and pointing it to a specific IP address, or registering on DynDNS to do the same thing. Note that if I move away from "123 Main Street" I must update my phone book listing for "Super Lemonade" to point to my new address.)

So now people see the Super Lemonade listing, come to 123 Main Street, and knock on the front door. But they're not getting any answer, because the security guard doesn't recognize them and refuses to let them in. (This is your home router firewall, doing its job.)

The final step is, I have to tell my security guard that if people ask for Super Lemonade, they can be escorted to Jay's Room. Keep locking everyone else out.

The other option, of course, is to rent a storefront at the mall, and run Super Lemonade out of the storefront. They'll provide all the security and janitorial services and I don't have to worry about any risk to my home, but of course I have to pay for that.

... now I'm thirsty. :D

JelvisChan
Jan 12, 2009, 02:25 PM
I have asked my dad if the Port 80 is on, and he said that it has to be on to be able to communicate with the web and the people on it.

PHP is already on Mac OS X, it is just not enabled by default.
I have done all the steps to enable PHP on my Mac, but it is just allowing people to access my Users/Sites folder on the web.

My firewall should allow all incoming connections outside my network because Port 80 is turned on.

If there is something wrong or something wrong about what I am doing, please tell me pronto because I have been working on this for a while and shutting off now is really not what I want to do right now because making my personal PHP enabled site universal is the last step to completing my process.

I am so close to finishing that it is not even funny.:confused::confused::confused::confused:

notjustjay
Jan 12, 2009, 02:50 PM
I have asked my dad if the Port 80 is on, and he said that it has to be on to be able to communicate with the web and the people on it.

With respect, this is not correct.

I can prove it with this simple thought experiment. Suppose you have five different computers in your home network. Suppose they are all running OS X, all with web sharing turned on, all running PHP, all listening on port 80, and each machine is set up to run a DIFFERENT script when you visit the page.

Now you click on http://lost.webhop.net/~jelvischan1. Which computer will receive the connection? Which script will run?

The answer is: the one you set up your router to connect with. You MUST configure your router to forward incoming port 80 TCP traffic to ONE of your computers in order to resolve this dilemma.

The fact that your computers can connect to the internet has nothing to do with inbound TCP port 80. In fact if you were to run a packet sniffer and analyze the incoming/outgoing traffic, you'll find that connections are being created with all kinds of port numbers. They are created as needed, and closed again when they're done.

You must follow some sort of procedure, like the following, which is a link to instructions for a typical Linksys router.

http://www.dnsexit.com/support/knowledge_base/router/Linksys-2.htm

If you, or someone else, has not explicitly followed those above steps, and specifically entered the local IP address of YOUR computer, then the router has no way to know that you intend for all incoming HTTP traffic to come to YOUR computer running the PHP script, as opposed to, say, your sister's computer.

If there is something wrong or something wrong about what I am doing, please tell me pronto because I have been working on this for a while and shutting off now is really not what I want to do right now because making my personal PHP enabled site universal is the last step to completing my process.


Nothing wrong with taking a break from it for a while. :) Best of luck, anyway, I hope our advice has been helpful.

JelvisChan
Jan 13, 2009, 01:55 PM
Do you know the way to enable it with T-Online.de?

I live in Germany, so everything on the router website is in German.

angelwatt
Jan 13, 2009, 02:16 PM
Do you know the way to enable it with T-Online.de?

I live in Germany, so everything on the router website is in German.

I found one router that T-Online possibly uses, the Teledat 400 (PDF) (http://www.t-home.de/dlp/eki/downloads/Teledat_Router_400_Quick_Start_Guide.pdf). The guide is in English and German. Eve if this isn't your specific router it may have enough information for you to get into a little more. On page 16 is starts talking about the web interface for it. It has you go to 192.168.1.1 and the default password is 1234. If the password has been changed I can't really help, except that a hard reset will some times reset all that (usually involves sticking a paper clip in a small hole for a couple seconds). Apparently the interface is in German though. The guide doesn't talk about port forwarding though. It's possible it doesn't have that feature.

If you can pick off any other primary names on the device, even if it is in German it may help us track it down. I don't speak German, but Google does pretty well translating pages.

notjustjay
Jan 13, 2009, 02:24 PM
By the way, if you're worried about fiddling with the modem/router settings, be aware that if you do it wrong and screw something up (very unlikely, but just in case) most routers have a reset switch, as the above poster indicated. That will reset the router to default settings.

JelvisChan
Jan 13, 2009, 02:37 PM
I can see about getting inside the router and looking at ports with my dad soon.


Please stay tuned for extra help if needed :)

JelvisChan
Jan 13, 2009, 03:06 PM
My dad says that he really doesn't want me messing around in the router, so I guess I can't do it:(. I probably could figure it out, but If he says no, he usually means NO!!

Maybe I could get 1 chance, but I would have to know the exact steps. Otherwise, all my work was for nothing.

JelvisChan
Jan 13, 2009, 03:24 PM
Also, for the default page (index.html) in the users/sites folder, why does it say that your friends from anywhere can access that website??

notjustjay
Jan 13, 2009, 03:25 PM
Understood. What about the other option, then, of buying some inexpensive web hosting?

Or perhaps we should back up a step. What exactly are you trying to accomplish, and must it be done in PHP? If it's just an email form, is there any way to do it using the services provided for you with MobileMe?

JelvisChan
Jan 13, 2009, 03:40 PM
I only have $10 in my PayPal account, and, unless I really know what I am doing with web hosting, I am not trying anything with that.

This is what I want to do.

Iweb-- regular html form in html snippet say:

<html>
<form action="sendmail.php" method="post" name="test">
<input type="text" name="email">
<input type="text" name="message">
<input type="submit" value="Send!">
</form>
</html>

Easy, right?

Now, for the php task:

<?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "myemail@host.com", "Mail!",
$message, "From: $email" );
header( "Location: http://blablabla.net" );
?>

This is all I want to do, and for the online form hosting, it either costs money or they only give you 2 or 3 forms. I like Wufoo, but i am not paying for that.

I looked into PHP because I wanted to process as many forms as a like, not just 2 or 3, and I would use all of the forms that I will put into my website.

Also, for this task ( HTML & PHP form processing ), whenever I double-click the sendmail.php file in my users/sites folder, I get an email with nothing in it because I opened the file. Is there any way to stop that?

Thanks...

angelwatt
Jan 13, 2009, 03:50 PM
Just a quick thing on your last question concerning it sending an email when you open the file. In your form add a hidden input:
<input type="hidden" name="sent" value="sent" />
Then in PHP create an if statement:
if ($_POST['sent'] == "sent") {
// Your email code here
}

jeremy.king
Jan 13, 2009, 03:59 PM
Sounds like you are in way over your head right now.

May I suggest you just use google forms - http://www.mattsilverman.com/2008/10/introduction-to-google-forms.html

http://docs.google.com

It's free and works without needing to know firewall config, apache config, PHP programming, etc...

FireArse
Jan 13, 2009, 04:00 PM
Hi op - you seem like a smart kid - you know what you're doing. Google up opening ports on ADSL routers. It's really no big deal. Most routers allow you to create backup config files before you start playing around with them. That way, if you screw up, revert to the last known working config!

You're really so close!

Look into who made your router and look up the instructions - explain to your dad what you propose to do - its perfectly safe & shouldn't be a big deal.

F

JelvisChan
Jan 13, 2009, 04:03 PM
I know it isn't a big deal, but I don't want to bug him about something he doesn't think should be messed with.

I guess I'll just scrap this idea, but I know I can do it someway.
I just like working with this stuff. Maybe someday in the future I'll come back to it!

angelwatt
Jan 13, 2009, 04:04 PM
I did a quick Google search and found this page that links some remotely hosted web forms. (http://www.hits4me.com/rem_email_form.php) I haven't used any of them so can't make recommendations or promises. The Google Forms mentioned by kingjr3 looks interesting too.

jeremy.king
Jan 13, 2009, 04:15 PM
The Google Forms mentioned by kingjr3 looks interesting too.

It's crazy easy! http://spreadsheets.google.com/viewform?key=p2hTX6JsfJPyyt8RTJzVUUA

notjustjay
Jan 13, 2009, 04:27 PM
I did some Google searching to see if I could help solve your problem. It looks like all you want to do is create an HTML form and email it to yourself. There are many ways to do this, using PHP, JSP, ASP, CGI, etc. Unfortunately, MobileMe/iWeb does not support any of these.

One option to consider is a "free" web hosting service. WebHero.com is an example -- it looks like you can sign up for a "free" package that supports PHP as long as you buy your domain from them for $11.95/year. That's not too bad. Google "free web hosting" and you'll see hundreds of hits. I imagine they all work in similar ways. Though I can't vouch for any of them personally.

It's really too bad that MobileMe doesn't offer some kind of scripting services, especially for all the money Apple charges.

I know you're set on doing it yourself on your own computer (that's certainly the free option) but your dad is right to be at least a little cautious. There are security issues with running your own HTTP server, not to mention you'll need to keep it running 24/7.

jeremy.king
Jan 13, 2009, 04:49 PM
Our very own AmbitiousLemon might be able to help. I don't speak for him, so hit him up via PM.

JelvisChan
Jan 14, 2009, 01:19 AM
Thanks guys, I'll see what I can do.

JelvisChan
Jan 14, 2009, 01:28 PM
Everyone try these links and tell me if you see anything:

http://Jelvis/~jelvischan1/
http://lost.webhop.net/~jelvischan1

angelwatt
Jan 14, 2009, 01:37 PM
Everyone try these links and tell me if you see anything:

http://Jelvis/~jelvischan1/
http://lost.webhop.net/~jelvischan1


The first link gave me a 404 error, but is not looking at your machine because it's not a proper domain (missing extension like .com, .net, etc.). The second link never connects to the server.

JelvisChan
Jan 14, 2009, 02:10 PM
The first link gave me a 404 error, but is not looking at your machine because it's not a proper domain (missing extension like .com, .net, etc.). The second link never connects to the server.

This is what you should see:
152953

I don't get it because it says clearly on that page ( the default page index.html ) that you can share it with your friends and family all around the world, but they don't tell the truth apparently.

JelvisChan
Jan 14, 2009, 02:12 PM
Tell me if you see this:

http://Jelvis.local/

angelwatt
Jan 14, 2009, 02:23 PM
Tell me if you see this:

http://Jelvis.local/

Nope, not that either. That's usually the name of a computer on your network, which is inaccessible outside your network. Apple isn't lying to you, it simply doesn't tell you that depending on your setup, there may be other things you have to setup.

It seems like a router issue still, port 80 isn't being directed to your machine. If you want to do a quick test, you can plug the internet cable directly to your machine rather than to the router. That way your machine will have the IP address directly rather than what the router hands it, and your domain name will point directly to your machine rather than to the router. This is just for testing though since others n your home would likely want to use the internet.

notjustjay
Jan 14, 2009, 03:07 PM
I don't get it because it says clearly on that page ( the default page index.html ) that you can share it with your friends and family all around the world, but they don't tell the truth apparently.

Well, it's a standard template text. Apple didn't write anything in there to account for the fact that most users are probably behind a router/NAT or firewall, and additional steps are required before your family and friends can see your page.

Any web address that ends in a ".local" is by definition not visible by anyone outside your local network.

Edit: Ah, I think I found your problem. When I ping lost.webhop.net it resolves to IP 192.168.2.22. This looks like the internal IP address of your computer on your local network. What you need to do is go back to DynDNS and resolve it to the IP address your router gets from your ISP. It should have a very different set of numbers.

Going back to the lemonade example that's like telling me to visit "room 22" to find your site. I have no idea where room 22 is unless you first tell me that I need to go to 123 Main Street.

If you're not sure what the IP address should be, try visiting http://www.dslreports.com/ip and see what it tells you.

JelvisChan
Jan 14, 2009, 03:22 PM
My current Ip address for lost.webhop.net is 192.168.2.22

My Internal IP Address: 192.168.2.22
My Router IP: 192.168.2.1
My dynDNS Auto Detected IP Address: 87.177.87.92

Which one do I stick in the IP Address at hosts in dyndns?

7031
Jan 14, 2009, 03:25 PM
My current Ip address for lost.webhop.net is 192.168.2.22

My Internal IP Address: 192.168.2.22
My Router IP: 192.168.2.1
My dynDNS Auto Detected IP Address: 87.177.87.92

Which one do I stick in the IP Address at hosts in dyndns?

87.177.87.92 is the correct one. However, you still need to set up port forwarding. For the last time, there is no other way. Sorry.

angelwatt
Jan 14, 2009, 03:25 PM
My current Ip address for lost.webhop.net is 192.168.2.22

My Internal IP Address: 192.168.2.22
My Router IP: 192.168.2.1
My dynDNS Auto Detected IP Address: 87.177.87.92

Which one do I stick in the IP Address at hosts in dyndns?

The last one. Ones that start with 192.168 are only accessible internally to your network.

JelvisChan
Jan 14, 2009, 03:26 PM
How am I suppose to forward a port when port 80 is already on?

angelwatt
Jan 14, 2009, 03:29 PM
How am I suppose to forward a port when port 80 is already on?

Unless you specifically configure it, only port 80 outbound is open (for browsers) not inbound port 80 (web server). There's two lanes.

JelvisChan
Jan 14, 2009, 03:32 PM
Tell me if you see this NOW:

http://lost.webhop.net

angelwatt
Jan 14, 2009, 03:37 PM
Tell me if you see this NOW:

http://lost.webhop.net

Nope

JelvisChan
Jan 14, 2009, 03:46 PM
I sent an email to my dad, we'll see what happens :) :)

jeremy.king
Jan 14, 2009, 03:51 PM
I sent an email to my dad, we'll see what happens :) :)

Please understand you can NOT host from home without the appropriate router port forwarding configured. Also, keep in mind some ISPs prevent it altogether no matter what you do to your router.

Asking people to test before you do this is a waste of our time.

JelvisChan
Jan 14, 2009, 03:53 PM
wat r ISPs??

jeremy.king
Jan 14, 2009, 03:55 PM
wat r ISPs??

Internet Service Provider - i.e. the company giving you access to the internetz

Here's a good read in the meantime, while you wait - http://computer.howstuffworks.com/web-server.htm

notjustjay
Jan 14, 2009, 05:31 PM
Jelvis, I just want to make sure you are aware that in order to run your PC as an HTTP server, you MUST leave it ON all the time, and connected to the internet. 24/7/365. This will cost you money in the form of electricity.

A page ago I linked you to a hosting company called WebHero that allows you to register a domain for US $11.99 per year, which includes a basic hosting package with 50 megs of disk space and PHP scripting. That's ONE American dollar per month. There are even cheaper hosting options, such as Nearly Free Speech (https://www.nearlyfreespeech.net/services/hosting.php) that offer "Pay As You Go" hosting packages. With the minimal bandwidth/space that your email form would require, this would cost you PENNIES per month.

Once again, I strongly recommend that you consider hiring out your hosting. For a simple thing like this, it's not worth the inconvenience of tying down your PC and the potential risk to your network, especially if this is something you're not comfortable with. (And particularly if it turns out that running your own HTTP server violates the Terms of Service agreement with your ISP.) The electricity costs alone for running your PC all day and all night would probably cost about as much.

This way you get to experiment with all the PHP you want, with NO risk to your own network. Please consider it.

JelvisChan
Jan 15, 2009, 12:09 AM
Do they take paypal? Lol

DocStone
Jan 15, 2009, 12:11 AM
Hey Jelvis, ever live in the Pittsburgh area? (Unique name, is why I ask)

JelvisChan
Jan 15, 2009, 01:37 PM
The name is because when we went on 2 cruises, the passport mistook me for Jerry, instead of Jeffrey.

The 2nd part of Jelvis is because my hair looks like Elvis :)

Chan is because my eyes look sort of Asian, although I am not.

notjustjay
Jan 16, 2009, 03:32 PM
Jelvis, I hope you are paying attention to this thread:

http://forums.macrumors.com/showthread.php?t=620058

Lots of good names of free web hosts you can try.

JelvisChan
Jan 16, 2009, 03:45 PM
Alright, there are a couple of things I need to configure before saving my port 80 settings.

I have gotten my dad's permission to do so, but here is what I need. It is all in German, so bear with me.

The Log (Protokoll in German) :
Either-
-TCP ( I think it is this one )
-UDP
-ESP
-GRE

It says (translated) :

Rerouted 1 of port - public:

There is a text field and has the number 80 (PORT) set by default.

The details for this says:
Enter a public TCP port here or public port areas.

Then it has this:

Rerouted 1 of port - private Client:

There is a text field and has the number 80 (PORT) set by default.

The details for this says:
Enter here a private Client port or a private Client port area.

Any ideas for what to put for these?
You think I should leave it the way it is?

JelvisChan
Jan 16, 2009, 03:50 PM
Test this link:

http://processor.selfip.com

If I did this correctly, this link should show up.

angelwatt
Jan 16, 2009, 04:11 PM
Test this link:

http://processor.selfip.com

If I did this correctly, this link should show up.

Slow to load (could be my end), but I got the Apache test page, so looks like you're in business.

JelvisChan
Jan 16, 2009, 05:29 PM
Alright, thanks for your help.

One more thing, though.
Just to make it easier on me, see if you can see THIS link:

http://processor.selfip.com/~jelvischan1/

Same thing, but it is my personal web, instead of the computer's.

I can change it back, but just try this and tell me.

Thanks!

angelwatt
Jan 16, 2009, 05:36 PM
No go on the new link. The previous one has stopped working too, FYI.

7031
Jan 16, 2009, 07:38 PM
Not loading for me. As someone pointed out, you need to leave your computer on 24/7 in order for this to work. If you are, and it's still not working, your IP has probably changed (I'm assuming this since someone else said it works, albeit slowly).

JelvisChan
Jan 17, 2009, 02:39 AM
Why do I have to leave my computer on always??????

Won't the router do that for me? That doesn't make sense.

7031
Jan 17, 2009, 06:20 AM
Why do I have to leave my computer on always??????

Won't the router do that for me? That doesn't make sense.
No. The router is just redirecting people to the files on your computer. If your computer is off, then people can't get to the files that you are hosting.

This is why everyone has been telling you to go for paid hosting, since it would work out cheaper in the long run. Saying that, Macs are pretty energy efficent, and for that matter, I have both paid hosting and my own Mac Mini server which runs 24/7.

JelvisChan
Jan 17, 2009, 07:22 AM
What's the cheapest website for this.

Hopefully they take PayPal.

angelwatt
Jan 17, 2009, 07:35 AM
What's the cheapest website for this.

Hopefully they take PayPal.

There's current threads going on discussing free web host. Take a read.

notjustjay
Jan 18, 2009, 07:17 PM
:eek:

OK, I'm done here. Hope that all the information and links I posted are helpful. Good luck with whatever it is you are trying to do.