0

hello
this is my problem
help11

how can do that in php ?

<html>

<FORM>
<TABLE BORDER="0">


<TR><TD>  facbook account :</TD>    <TD><INPUT TYPE="text" NAME="facbook account" MAXLENGTH="50"><TD><INPUT TYPE="SUBMIT" NAME="save1" VALUE="save"></TD></TR>

</FORM>
</html>

thanks

3
Contributors
15
Replies
16
Views
5 Years
Discussion Span
Last Post by don't give up
Featured Replies
  • 1
    diafol 3,720   5 Years Ago

    OK, I think I get it. You want to save the facebook account data in the user's profile data. Then when you enter the user's profile page, the facebook icon takes you to the facebook account page. 1) Set up form as you've done (html code). 2) Set up a … Read More

0

Heres something to start you off:

<?php
if(isset($_POST['facebookaccount'])){
    $acc = $_POST['facebookaccount'];
}else{
    $acc = false;
}
?>
<html>
<body>
    <form action='post'>
        <table BORDER="0">
            <tr>
                <td>facbook account :</td>
                <td><input type="text" name="facebookaccount" maxlength="50"/></td>
                <td><input type="SUBMIT" name="save1" value="save"/></td>
            </tr>
        </table>
    </form>
    <?php
    if($acc !== false){
        echo "http://www.facebook.com/{$acc}";
    }
    ?>
</body>
</html>

Heres a reference to setcookie() you can store data on a users pc with that

0

oh , thanks alot

but i want show facebook icon in another bage <
how can do that ?

1

OK, I think I get it. You want to save the facebook account data in the user's profile data. Then when you enter the user's profile page, the facebook icon takes you to the facebook account page.

1) Set up form as you've done (html code).
2) Set up a processing page (php code) to accept the $_POST data. This is then used to update the user's profile in your DB. If this is successful, redirect to the profile page, otherwise redirect to the form page.
3) The profile page takes info from the DB to build the facebook icon link:

if(isset($fb_account))echo "<a href=\"http://www.facebook.com/$fb_account\" target = \"_blank\"><img src=\"imgs/fb_icon.png\" /></a>
0

how can save account in database if enter ?
and then display if enter icon facebook

Because this code not the desired result :""(
please help me ,,

0

DO you know mysql and how to manipulate it in php? If not, bone up on this - plenty of resources on the internet.

Edited by diafol

0

my try

code start.php

<?php
if(isset($_POST['facebookaccount'])){
    $acc = $_POST['facebookaccount'];
}else{
    $acc = false;
}
?>
<html>
<body>
    <form action="go.php" method="get">
        <table BORDER="0">
            <tr>
                <td>facbook account :</td>
                <td><input type="text" name="facebookaccount" maxlength="50"/></td>
                <td><input type="SUBMIT" name="save1" value="save"/></td>
            </tr>
        </table>
    </form>


</body>
</html>

code go.php

<?php
if(isset($acc))
echo "<a href=\"http://www.facebook.com/$acc\" target = \"_blank\"><img src='http://www.buttonshut.com/Facebook-Buttons/Facebook-Buttons-1-10-.png'/></a>";
?>

this code not working

this out put :
!

0

sort of

<form action="go.php" method="get">

There are 2 methods to send data, one is GET this sends the variables in the url and the other is POST which sends the variables in the HTTP request, might be best not to bother going into POST - just say it sends the variables in a hidden way to the next page.

eg.
GET -> URL = go.php?facebookaccount=kkkkk
no extra data

POST -> URL = go.php
extra data = facebookaccount=kkkkk

Now on your go.php page, php picks up these variables and assigns them to 2 different arrays:

GET data goes into -> $_GET

POST data goes into -> $_POST

They both use the key for reference as set in the input name <input name='facebookaccount'/>

eg

echo $_GET['facebookaccount'];//in the above example using method = 'GET' will print out "kkkkk"
echo $_POST['facebookaccount'];//in the above example using method = 'POST' will print out "kkkkk"

It is safer to use POST when you can

See if you can get go.php working with that!

Edited by Biiim

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.