arbondurant Posted October 22, 2006 Share Posted October 22, 2006 Hi,I am in the process of creating a URL redirection site and I need some help/advice. I have the following code setup for the site: <html><body bottommargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" scroll="no" topmargin="0"><table cellpadding="0" cellspacing="0" height="100%" width="100%"><td height="31" width="100%"><div style="height:31px;overflow:hidden"><table cellpadding="0" cellspacing="0" height="31" width="100%"><td align="left" height="31" valign="top"><center>Logo Here</center></td></td></table></div></td><tr><td height="100%" width="100%"><iframe frameborder="0" height="100%" src="http://yahoo.com" width="100%"><script>location="http://yahoo.com"</script><a href="http://yahoo.com">http://yahoo.com</a></iframe></td></table> And it looks like this: http://www.surplusmagazineshop.com/redirecting/index.php.But I need to figure out how to do two more things:#1 - How they can create their redirection using a form? I am wanting something simple, like this: Username (www.xxxxx.mysite.com): _____________Password* : ______________"Create Page" * I would rather have a random passcode generated so they can change their URL if this is possible.I just can't figure out the easiest way to do this - will I have to use MySQL?And problem #2 is that I have no idea how to set this up to where their username is a subdomain that is automatically setup at signup. I have seen other sites that do this but I have no clue about it.Any help would be appreciated ThanksAaronPS: I put this in the PHP section because that is what I would like to write it in, unless there is an easier way. Link to comment Share on other sites More sharing options...
www.mihalism.com Posted October 22, 2006 Share Posted October 22, 2006 For the random passcode you could do something simple like <?php$uni = md5 (uniqid (rand()));$echo = substr($uni, 0, 10);echo $echo;?> Link to comment Share on other sites More sharing options...
jhecht Posted October 22, 2006 Share Posted October 22, 2006 ok well, all i can tell you is that this is going to cause you more pain then necessary. PHP... i dont know it might be able to handle it, but im not quite sure.And you would be dealing with DNS and so on, honetly if i were you, i wouldnt do this. honestly im not sure how you would go about doing this, i guess mod_rewrite on apache might be able to do something but.. hey i have no idea honestly, might want to look into that on APACHE, the mod_rewrite code styleother than that, can't help you. Link to comment Share on other sites More sharing options...
arbondurant Posted October 23, 2006 Author Share Posted October 23, 2006 Well, I know that CJB.net (a competitor site) uses CGI. The only problem is I don't know much at all about CGI. I've only dealt with a few PHP sites in the past and I'm no pro at that either.Here is CJB's registration page:http://www.cjb.net/cgi-bin/register.cgiAnd here is an example of one of their redirected pages:http://1pennyhosting.cjb.netDoes anyone have any ideas about how they may have done it, and how I could do the same?If I can't figure this out I may pay someone to set it up for me. Any suggestions for a cheap programmer or how to find one? And how much should I pay for something simple like this?Thanks a ton :)Aaron Link to comment Share on other sites More sharing options...
boen_robot Posted October 23, 2006 Share Posted October 23, 2006 Here is CJB's registration page:http://www.cjb.net/cgi-bin/register.cgiAnd here is an example of one of their redirected pages:http://1pennyhosting.cjb.net Creepy. I would never give my peny and/or $9.95 dollars for this. If this host was truly a host, he would have at least got himself a real domain.As for this cjb page... why exactly do they need my email again? I mean, aren't they just redirecters? Couldn't I just have a login and that's that. Link to comment Share on other sites More sharing options...
arbondurant Posted October 23, 2006 Author Share Posted October 23, 2006 The 1pennyhosting.cjb.net was just an example that I created redirecting to http://1pennyhosting.com to show what the redirection looks like.And I have been wondering the same thing - why the email? I want to create a simple 1-2-3 form:1. Username (www.xxxxx.mysite.com)2. Password3. Site that you want to redirect to.Why would I need anything else? I also don't like the annoying layer ad. I know that it would make more money but I would rather attract 3X more customers by reducing the advertising.I will probably use http://elance.com but I don't know how much to pay for something like this. If anyone is familiar with outsorcing, I would appreciate some advice :)ThanksAaron Link to comment Share on other sites More sharing options...
emporas Posted October 24, 2006 Share Posted October 24, 2006 If I understand well, you need something like this<html><head><script type="text/javascript" language="JavaScript"><!--function Redirect(){ //do_something with usename or password, probably validate somehow location.href = document.login.siteRedirection.value;}// --></script></head><body><center><form name="login" method="Post" >Username <input type="text" name="username" size="30" ><br>Password <input type="password" name="pass" size="30" ><br>Site <input type="text" name="siteRedirection" size="30" ><br><input type="button" onClick="Redirect()" value="Submit"></form></center></body></html>I hope this was useful. If you want to program, exactly what you want just mail me Link to comment Share on other sites More sharing options...
arbondurant Posted October 24, 2006 Author Share Posted October 24, 2006 If I understand well, you need something like this<html><head><script type="text/javascript" language="JavaScript"><!--function Redirect(){ //do_something with usename or password, probably validate somehow location.href = document.login.siteRedirection.value;}// --></script></head><body><center><form name="login" method="Post" >Username <input type="text" name="username" size="30" ><br>Password <input type="password" name="pass" size="30" ><br>Site <input type="text" name="siteRedirection" size="30" ><br><input type="button" onClick="Redirect()" value="Submit"></form></center></body></html>I hope this was useful. If you want to program, exactly what you want just mail meSo I am guessing that I would need to create databases for this? That is where I have been running into problems because I am not good with MySQL. Link to comment Share on other sites More sharing options...
emporas Posted October 24, 2006 Share Posted October 24, 2006 If you have small number of users you do not need to create databases, just create a file (with extension .php so as not be able to see it with browser, everyone). If not you have to create databases, and create a PHP script that make queries to validate the users. Do you need exactly the queries that create the database? Link to comment Share on other sites More sharing options...
aspnetguy Posted October 24, 2006 Share Posted October 24, 2006 I recommend using a database even if it is small. This allows for easy expansion later with no extra development work.Try the PHP/MySql tutorial if you are having some troubles. Link to comment Share on other sites More sharing options...
Skemcin Posted October 24, 2006 Share Posted October 24, 2006 yeah, a database is going to be a requirement, even if you want the application to be transparent.you'll need a table with at least these columns:rdr_key - unique identifierrdr_subdomain - the domain prefix you assign to the redirect (or they choose and you dup check)rdr_longurl - the url that gets populated in the main content framehmmm, this can be done in a few hours with cold fusion, hmmmm . . . . Link to comment Share on other sites More sharing options...
arbondurant Posted October 24, 2006 Author Share Posted October 24, 2006 Thanks a lot everyone for the replies :)So would I be able to do the same job in PHP that a competitor site uses CGI for?I just downloaded the trial version of Cold Fusion and I will try to figure out how to implement it with my site.The only issue now is how to allow them to instantly create a subdomain on my site. I have researched this but I can't figure it out. There are thousands of free hosting sites that do this so I know its possible. Link to comment Share on other sites More sharing options...
arbondurant Posted October 27, 2006 Author Share Posted October 27, 2006 UPDATE:Look at the progress that I have made trying to do the site on my own http://www.surplusmagazineshop.com/redirection2/Username: demoPassword: demoI've kinda figured out how to do the subdomain - I will have to find a host that supports WildCard DNS (which means that when you type in xxxxx.yourdomain.com, you get yourdomain.com/xxxxx). Anyway, I'll figure out that later.The question that I have now is something that I think that some of you here may understand and can explain to me: How can I redirect the users page using http://mysite.com/xxxxxx. Once I figure out this I should be able to figure out how to make that a subdomain.Here is part of the code that I am using to create the masked URL: <iframe frameborder="0" height="100%" src="HTTP://THEIR-SITE.COM" width="100%"><script>location="HTTP://THEIR-SITE.COM"</script><a href="HTTP://THEIR-SITE.COM>HTTP://THEIR-SITE.COM</a></iframe></td></table> As you see, I need to be able to replace HTTP://THEIR-SITE.COM with the users actual site. Is there anyway to do this using http://mysite.com/username. I know that you can do this by using http://mysite.com?id=username, but that wouldn't work with this.Do you understand what I mean?Thanks for the help :)Aaron Link to comment Share on other sites More sharing options...
jhecht Posted October 27, 2006 Share Posted October 27, 2006 once you get it to the point where you have mysite.com/xxxxx you can use apache's mod_rewrite and have it send every thing after the mysite.com to a PHP page which would redirect through MySQL from there. Link to comment Share on other sites More sharing options...
Little Goat Posted October 30, 2006 Share Posted October 30, 2006 I knwo why they would need a Email, in case you forget your password. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now