PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello all,
I am assuming that what I need is simple enough and easy, but I'm still a novice at PHP coding...
I want to be able to have a user enter their domain name (Eg:aol.com) and when they click on submit, it pops a new window and sets the URL to "http://www.aol.com/cpanel/"
I imagine it would go something like this, but I am not 100% sure on the actual coding.
[syntax="html"]<form method=post>
<strong> Enter your domain name: </strong>
<input type="text" name="domain">
<font color="#000066" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input type="submit" name="submit">
</form>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
<?php
$browser_url = '';
if (isset($_POST['domain']))
{
$browser_url = 'http://www.' . $_POST['domain'] . '/cpanel';
}
if (!empty($browser_url))
{
echo '<a href="' . $browser_url . '" target="_blank">SOME TEXT TO CLICK ON</a>';
}
?>
Keep in mind that this is rudimentary at best and in no way handles security, which should be considered before putting anything like this into production.
Hi again, I see that the code you supplied generates a link to click on... that can work, but I was just hoping to popup a window when they click on the submit button...
I am looking for someone to enter their domain (eg: bcswebhost.com), they click on a button and a new window pops up bringing them to their CPanel.... a redirect...
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Does anyone have a simple solution? I can't imagine this being so difficult. I have an idea, but I'm not sure how to implement it with adding the "Http://www." and the "/cpanel" after the users input.