|
Okay... I've seemed to have used some common sense in putting this together... Now all I need is some help to finish it. The "memberlist" page shows fine... it's just the "profile" page... Here is the code for the part of the "memberlist" that will be used with the "profile" page... I want to know if I've done it practically right...
<?
$list_members = mysql_query("SELECT * FROM `members` ORDER BY id");
$list = mysql_fetch_array( $list_members );
while($list = mysql_fetch_array( $list_members ))
{
Print '<tr class="alt"><td><b>';
Print "<form action='profile.php' method='GET'>".$list['username']."<input type='hidden' name='username' value='".$list['username']."' /></b></td><td><input type='hidden' name='user' value='".$list['id']."' /><input type='submit' value='Visit' class='submit'/></form></td><td>".$list['country']."</td><td><a href='".$list['www']."'>".$list['www']."</a></td><td>".$list['browser']."</td></tr>";
}
?>
That is what I use to print out the table of members...
And here is the complete php for the "profile.php" page:
<?
include_once"config.php";
$fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_GET['username']."'"));
$fetch_users_id = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'"));
?>
<html>
<head>
<title>Members - Profile - <? echo "".$fetch_users_data->username.""; ?> ~ Bio-Designs</title>
<style type="text/css">
<!--
a {color: #000000; text-decoration: none;}a:link {color: #000000} a:visited {color: #000000} a:hover {color:#000000; width:7em} body{color: #FF0000} .dockmenu{ text-align: center; height: 50px; position: relative;}a.dockItem { text-align: center; color: #000;font-weight: bold; text-decoration: none; width: 50px; position: absolute; display: block; bottom: 0;}.dockItem img { border: none; margin: 0 auto 5px auto; width: 75%;}.dockItem span { display: none; positon: absolute;}.dockmenuContainer { height: 50px; left: 76px; position: absolute; top: 40px;}font {color: FF0000;}<!--BODY { scrollbar-arrow-color:#000000; scrollbar-track-color:#000000; scrollbar-shadow-color:#000000; scrollbar-face-color:#FF0000; scrollbar-highlight-color:#FF0000; scrollbar-darkshadow-color:#000000; scrollbar-3dlight-color:#FF0000; } table, td, th{border:0px 1px 0px 1px dashed #FF0000;
padding:2px 2px 2px 2px;} tr.alt { background-color: #FF0000; color: #000000; border: 1px dotted red;}
</style>
<link rel="icon" type="image/gif" href="http://i248.photobucket.com/albums/gg195/Bio-Gfx/thebiostylefavicon.gif">
</head>
<body bgcolor="#000000" onload="$_GET['user']">
<br />
<div>
<div style="text-align: center;">
<img src="http://www.thebiostyle.com/biologoblackv1.0.png" /><br /><br />
<div align="center">
<span style="font-size: 24pt; color: rgb(255, 0, 0);"><u><b>Profile</b></u></span><br /><br />
<table cellspacing="4" cellpadding="4" style=" border:1px dotted red;">
<tr class="alt" style=" border:1px dashed red;">
<td><span style="font-size: 14pt; color: rgb(0, 0, 0);"><center><b><u>Username</u></b></center></span></td>
<td><span style="font-size: 14pt; color: rgb(0, 0, 0);"><center><b><u>Country</u></b></center></span></td>
<td><span style="font-size: 14pt; color: rgb(0, 0, 0);"><center><b><u>WWW</u></b></center></span></td>
<td><span style="font-size: 14pt; color: rgb(0, 0, 0);"><center><b><u>Browser</u></b></center></span></td></tr>
<?
$list_memberinfo = mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'");
$list = mysql_fetch_array( $list_memberinfo );
while($list = mysql_fetch_array( $list_memberinfo ))
{
Print '<tr class="alt"><td><b>';
Print "".$list['username']."</b></td><td>".$list['country']."</td><td><a href='".$list['www']."'>".$list['www']."</a></td><td>".$list['browser']."</td></tr><tr><td><span style="font-size: 14pt; color: rgb(0, 0, 0);"><left><b><u>About</u></b></left></span></td></tr><tr><td>".$list['about']."</td></tr>";
}
?>
</div>
</table>
<br /><br />
<span style="color: rgb(255, 0, 0);">| 2009-<script type="text/javascript">
var d = new Date();
document.write(d.getFullYear());
</script> Bio-Designs |</span><br style="color: rgb(255, 0, 0);" />
<br />
</body>
</html>
It says this when I try to run the page... "
Parse error: syntax error, unexpected T_STRING in profile.php on line 42
"
Should the form method have been "POST"...? Please fix my errors for me... Thanks I tried my best.
|
|
|
|
|
The error message is about the <span style="font-size: 14pt; color: rgb(0, 0, 0);"> bit on line 42 - since it is inside a double-quoted string, the double-quotes have to be escaped with backslashes:
<span style=\"font-size: 14pt; color: rgb(0, 0, 0);\">
This kind of thing is dangerous though:
$list_memberinfo = mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'");
I suggest you Google for "SQL injection".
|
|
|
|
|
Well... Thanks on the first one, but the second one is supposed to be used with the "memberlist" page, to where when they click "visit" it will link them to the profile page of which will take the hidden input of the ".list[id]." which is the id number of the user they chose to visit, as the "'".$_GET['user']."'" so that on the profile page it will automatically "get the id" and print out only the information for that id. So the url will in turn turn out to be like this.....
"profile.php?user=IDOFUSERTHEYCHOSETOVISIT" I need some help with that part of it... I don't know if where I put all the GETs if they should be POSTs... or any other implementation that would help me to get this to work. Thanks.
EDIT: I also added the backslashes to all the "spans" and it now loads the page... but it doesn't print any of the information out... Please help... I would like the finished profile page to look like...
This is what it does read... so I'm not that far into a hole I think...
profile.php?username=USERNAMEOFCHOSENMEMBER&user=IDOFCHOSENMEMBER
"profile.php?user=IDOFUSERTHEYCHOSETOVISIT"
modified on Saturday, January 23, 2010 10:40 AM
|
|
|
|
|
It's not printing anything because of this:
$list_memberinfo = mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'");
$list = mysql_fetch_array( $list_memberinfo );
while($list = mysql_fetch_array( $list_memberinfo ))
Presumably the id is unique, so the first (and only) record is retrieved with the first call to mysql_fetch_array , then it gets called again for the while loop where the value you got first in $list is thrown away. Then the while condition will fail, because you've already got the one record out.
Try changing it to this:
$list_memberinfo = mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'");
while($list = mysql_fetch_array( $list_memberinfo ))
- or you could remove the "while" line instead, maybe replacing it with
if(!empty($list))
As for $_POST and $_GET - GET is the one you want for this. In the GET method, the parameters are passed in as part of the URI. In the POST method, the parameters are passed in the body of the request, and you would need to use a form to do that in HTML. Or you could use $_REQUEST instead, which contains everything from POST and GET, and the cookies too.
|
|
|
|
|
Okay thanks... I guess the first part was just a stupid mistake... even though it worked in the "memberlist" file..... But thanks, it now works. The "Edit Profile" page should include... Such like:
mysql_query("UPDATE `DBNAME`.`TABLE` SET VARIABLE = '$_POST[VARIABLE]'
WHERE username = '$SINGEDINUSERNAME' AND password = '$DIGNEDINUSER'SPASSWORD'");
I believe, and then it would be edited to where the user can edit multiple profile fields of which would be displayed on their profile!! Thanks so much for your help.
Also, how would I be able to make the "Profile" page not include the "username=" in the url...
Also, I tried adding more profile fields to make it seem as though there was 4 tables, when there is actually 1... I tried making it print it all out, now I need help to get it fixed...
here is the code:
<?
include_once"config.php";
$fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_REQUEST['username']."'"));
$fetch_users_id = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'"));
?>
<html>
<head>
<title>Members - Profile - <? echo "".$fetch_users_data->username.""; ?> ~ Bio-Designs</title>
<style type="text/css">
<!--
a {color: #000000; text-decoration: none;}a:link {color: #000000} a:visited {color: #000000} a:hover {color:#000000; width:7em} body{color: #FF0000} .dockmenu{ text-align: center; height: 50px; position: relative;}a.dockItem { text-align: center; color: #000;font-weight: bold; text-decoration: none; width: 50px; position: absolute; display: block; bottom: 0;}.dockItem img { border: none; margin: 0 auto 5px auto; width: 75%;}.dockItem span { display: none; positon: absolute;}.dockmenuContainer { height: 50px; left: 76px; position: absolute; top: 40px;}font {color: FF0000;}<!--BODY { scrollbar-arrow-color:#000000; scrollbar-track-color:#000000; scrollbar-shadow-color:#000000; scrollbar-face-color:#FF0000; scrollbar-highlight-color:#FF0000; scrollbar-darkshadow-color:#000000; scrollbar-3dlight-color:#FF0000; } table, td, th{border:0px 1px 0px 1px dashed #FF0000; padding:2px 2px 2px 2px;} td.alt {font-size:14pt; color: #000000;} tr.alt { background-color: #FF0000; color: #000000; border: 1px dotted red;}
</style>
<link rel="icon" type="image/gif" href="http://i248.photobucket.com/albums/gg195/Bio-Gfx/thebiostylefavicon.gif">
</head>
<body bgcolor="#000000" onload="$_GET['user']">
<br />
<div>
<div style="text-align: center;">
<img src="http://www.thebiostyle.com/biologoblackv1.0.png" /><br /><br />
<div align="center">
<span style=\"font-size: 24pt; color: rgb(255, 0, 0);\"><font size=\"20pt\" color=\"#FF0000\"><u><b>Profile</b></u></font></span><br /><br />
<table cellspacing="4" cellpadding="4" style=" border:1px dotted red;">
<?
$list_memberinfo = mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'");
while($list = mysql_fetch_array( $list_memberinfo ))
{
Print '<tr class="alt"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Username</u></b></center></span></td><td><b>';
Print "".$list['username']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Email</u></b></center></span></td><td><a href='mailto:".$list['email']."'>Send Message</a></td></tr><tr class="alt"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Member Title</u></b></center></span></td><td><b>
".$list['title']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Country</u></b></center></span></td><td>".$list['country']."</td></tr><tr class="alt"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Company</u></b></center></span></td><td><b>
".$list['company']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Website</u></b></center></span></td><td>".$list['www']."</td></tr><tr class="alt"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Joined On: </u></b></center></span></td><td><b>
".$list['date']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Browser</u></b></center></span></td><td>".$list['browser']."</td></tr><br /><br /><br /><tr class="alt"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>About</u></b></center></span></td><td><b>
".$list['about']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Intrests</u></b></center></span></td><td>".$list['intrests']."</td></tr>";
}
?>
</div>
</table>
<br /><br />
<span style="color: rgb(255, 0, 0);">| 2009-<script type="text/javascript">
var d = new Date();
document.write(d.getFullYear());
</script> Bio-Designs |</span><br style="color: rgb(255, 0, 0);" />
<br />
</body>
</html>
Here is the error message:
"Parse error: syntax error, unexpected T_STRING in profile.php on line 35"
Also, here is a link to an image of what I would like it to look like, so you can get a better image of what I was going for...
http://i248.photobucket.com/albums/gg195/Bio-Gfx/profilelayout.png
That should give you everything that I want to be displayed on the profile page... THANKS!!
|
|
|
|
|
 thebiostyle wrote:
Print "".$list['username']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><center><b><u>Email</u></b></center></td><td><a href='mailto:".$list['email']."'>Send Message</a></td></tr><tr class="alt"><td class="alt"><center><b><u>Member Title</u></b></center></td><td><b>
".$list['title']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><center><b><u>Country</u></b></center></td><td>".$list['country']."</td></tr><tr class="alt"><td class="alt"><center><b><u>Company</u></b></center></td><td><b>
".$list['company']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><center><b><u>Website</u></b></center></td><td>".$list['www']."</td></tr><tr class="alt"><td class="alt"><center><b><u>Joined On: </u></b></center></td><td><b>
".$list['date']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><center><b><u>Browser</u></b></center></td><td>".$list['browser']."</td></tr><br /><br /><br /><tr class="alt"><td class="alt"><center><b><u>About</u></b></center></td><td><b>
".$list['about']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"></td><td class=\"alt\"><td class="alt"><center><b><u>Intrests</u></b></center></td><td>".$list['intrests']."</td></tr>";
Graham gave you the solution earlier. You still have unescaped double quotes in your string, <td class="alt"> in particular.
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Okay... Thanks, it now shows the page and loads the information... But how do I fix the...
"profile.php?username=USERNAMEOFCHOSENUSER&user=IDOFCHOSENUSER"
to
"profile.php?user=IDOFCHOSENUSER"
THANKS!
EDIT: There is something... "humorously fatal" on the profile page... The first two "columns in the first row"... Are turning "Background Color = limegreen, Font Color = red"... Here is the code:
<td bgcolor=\"#FF0000\" color=\"#000000\"><center><b><u>Username</u></b></center></td><td bgcolor=\"#FF0000\" color=\"#000000\"><b>';
Print "".$list['username']."</b></td>
So obviously somethings wrong... I can take a screenshot and post a link to it if ya'd like...
Thanks.
modified on Saturday, January 23, 2010 4:16 PM
|
|
|
|
|
thebiostyle wrote: Okay... Thanks, it now shows the page and loads the information... But how do I fix the...
"profile.php?username=USERNAMEOFCHOSENUSER&user=IDOFCHOSENUSER"
to
"profile.php?user=IDOFCHOSENUSER"
You change the link, obviously.
eg.
<a href="profile.php?username=USERNAMEOFCHOSENUSER&user=IDOFCHOSENUSER">Link</a> Will be:
<a href="profile.php?user=IDOFCHOSENUSER">Link</a>
thebiostyle wrote:
<td bgcolor=\"#FF0000\" color=\"#000000\"><center><b><u>Username</u></b></center></td><td bgcolor=\"#FF0000\" color=\"#000000\"><b>';
Print "".$list['username']."</b></td>
It's obviously not that line. Do you have any other styles affecting it i.e. from a Style Sheet?
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
 Well, when I took out that line it showed as BG=black FC=red, but I don't know, maybe you can find the mistake... Here is the code for "profile.php":
<?
include_once"CONFIGPAGE.php";
$fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_REQUEST['username']."'"));
$fetch_users_id = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'"));
?>
<html>
<head>
<title>Members - Profile - <? echo "".$fetch_users_data->username.""; ?> ~ Bio-Designs</title>
<style type="text/css">
<!--
a {color: #000000; text-decoration: none;}a:link {color: #000000} a:visited {color: #000000} a:hover {color:#000000; width:7em} body{color: #FF0000} .dockmenu{ text-align: center; height: 50px; position: relative;}a.dockItem { text-align: center; color: #000;font-weight: bold; text-decoration: none; width: 50px; position: absolute; display: block; bottom: 0;}.dockItem img { border: none; margin: 0 auto 5px auto; width: 75%;}.dockItem span { display: none; positon: absolute;}.dockmenuContainer { height: 50px; left: 76px; position: absolute; top: 40px;}font {color: FF0000;}<!--BODY { scrollbar-arrow-color:#000000; scrollbar-track-color:#000000; scrollbar-shadow-color:#000000; scrollbar-face-color:#FF0000; scrollbar-highlight-color:#FF0000; scrollbar-darkshadow-color:#000000; scrollbar-3dlight-color:#FF0000; } table, td, th{border:0px 1px 0px 1px dashed #FF0000; padding:2px 2px 2px 2px;} td.alt {font-size:14pt; color: #000000;} tr.alt { background-color: #FF0000; color: #000000; border: 1px dotted red;}
</style>
<link rel="icon" type="image/gif" href="http://i248.photobucket.com/albums/gg195/Bio-Gfx/thebiostylefavicon.gif">
</head>
<body bgcolor="#000000" onload="$_GET['user']">
<br />
<div>
<div style="text-align: center;">
<img src="http://www.thebiostyle.com/biologoblackv1.0.png" /><br /><br />
<div align="center">
<span style=\"font-size: 24pt; color: rgb(255, 0, 0);\"><font size=\"20pt\" color=\"#FF0000\"><u><b>Profile</b></u></font></span><br /><br />
<table cellspacing="4" cellpadding="4" style=" border:1px dotted red;">
<?
$list_memberinfo = mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'");
while($list = mysql_fetch_array( $list_memberinfo ))
{
Print '<tr class=\"alt\"><td class=\"alt\" bgcolor=\"#FF0000\" color=\"#000000\" colspan=\"2\"><span style=\"font-size: 16pt; color: rgb(0, 0, 0); background-color: black;\"><center><b><u>Information</u></b></center></span></td><td bgcolor=\"#000000\" colspan=\"2\"> </td><td class=\"alt\" bgcolor=\"#FF0000\" color=\"#000000\" colspan=\"2\"><span style=\"font-size: 16pt; color: rgb(0, 0, 0); background-color: black;\"><center><b><u>General</u></b></center></span></td></tr><tr class=\"alt\"><td bgcolor=\"#FF0000\" color=\"#000000\"><center><b><u>Username</u></b></center></td><td bgcolor=\"#FF0000\" color=\"#000000\"><b>';
Print "".$list['username']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"> </td><td class=\"alt\" bgcolor=\"#FF0000\" color=\"#000000\"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Email</u></b></center></span></td><td class=\"alt\" bgcolor=\"#FF0000\" color=\"#000000\"><a href='mailto:".$list['email']."'>Send Message</a></td></tr><tr class=\"alt\"><td class=\"alt\"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Member Title</u></b></center></span></td><td><b>
".$list['title']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"> </td><td class=\"alt\"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Country</u></b></center></span></td><td>".$list['country']."</td></tr><tr class=\"alt\"><td class=\"alt\"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Company</u></b></center></span></td><td><b>
".$list['company']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"> </td><td class=\"alt\"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Website</u></b></center></span></td><td>".$list['www']."</td></tr><tr class=\"alt\"><td class=\"alt\"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Joined On: </u></b></center></span></td><td><b>
".$list['date']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"> </td><td class=\"alt\"><span style=\"font-size: 14pt; color: rgb(0, 0, 0);\"><center><b><u>Browser</u></b></center></span></td><td>".$list['browser']."</td></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr bgcolor=\"#000000\"></tr><tr class=\"alt\"><td class=\"alt\" colspan=\"2\"><span style=\"font-size: 16pt; color: rgb(0, 0, 0);\"><center><b><u>About</u></b></center></span></td><td bgcolor=\"#000000\" colspan=\"2\"> </td><td class=\"alt\" colspan=\"2\"><span style=\"font-size: 16pt; color: rgb(0, 0, 0);\"><center><b><u>Intrests</u></b></center></span></td></tr><tr class=\"alt\"><td colspan=\"2\" height=\"100px\" valign=\"top\"><b>
".$list['about']."</b></td><td bgcolor=\"#000000\" colspan=\"2\"> </td><td colspan=\"2\" height=\"100px\" valign=\"top\">".$list['intrests']."</td></tr>";
}
?>
</div>
</table>
<br /><br />
<span style="color: rgb(255, 0, 0);">| 2009-<script type="text/javascript">
var d = new Date();
document.write(d.getFullYear());
</script> Bio-Designs |</span><br style="color: rgb(255, 0, 0);" />
<br />
</body>
</html>
Here is the code from the "memberlist page" that is being passed to the profile page...:
<?
$list_members = mysql_query("SELECT * FROM `members` ORDER BY id");
$list = mysql_fetch_array( $list_members );
while($list = mysql_fetch_array( $list_members ))
{
Print '<tr class="alt"><td><b>';
Print "<form action='profile.php' method='GET'>".$list['username']."<input type='hidden' name='username' value='".$list['username']."' /></b></td><td><input type='hidden' name='user' value='".$list['id']."' /><input type='submit' value='Visit' class='submit'/></form></td><td>".$list['country']."</td><td>".$list['browser']."</td></tr>";
}
?>
THANKS for all your help.
|
|
|
|
|
thebiostyle wrote: <form action='profile.php' method='GET'>
Do you know what the GET method of submitting a form actually does?
Every input within the form, has their value displayed in the URL on the action page (the page the form is submited to).
E.g.
<form action="submit.php" method="get">
<input type="hidden" name="fieldName" value="fieldValue" />
<input type="hidden" name="fieldName2" value="fieldValue2" />
</form> Would direct to submit.php?fieldName=fieldValue&fieldName2=fieldValue2
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Yes, I know that, but in an earlier post, it said that I was right to use the "GET" method. Also, Did you find anything out about the "color" issue...?
|
|
|
|
|
thebiostyle wrote: Yes, I know that, but in an earlier post, it said that I was right to use the "GET" method.
thebiostyle wrote: Okay... Thanks, it now shows the page and loads the information... But how do I fix the...
"profile.php?username=USERNAMEOFCHOSENUSER&user=IDOFCHOSENUSER"
to
"profile.php?user=IDOFCHOSENUSER"
ALL the inputs in your form are sent to the URL, if you don't want them in the URL then don't have them in the form!
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Before you continue, I suggest you tidy up your code and get into some good practices.
thebiostyle wrote: include_once"CONFIGPAGE.php";
Encapsulate the target file in brackets: include_once('CONFIGPAGE.php'); . And use single quotes, as it is quicker.
thebiostyle wrote:
$fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_REQUEST['username']."'"));
$fetch_users_id = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'"));
You need to check first whether or not 'user' and 'username' are set. If they aren't then it will throw errors.
$username = isset( $_REQUEST['username'] ) ? $_REQUEST['username'] : '';
$user = isset( $_GET['user'] ) ? $_GET['user'] : ''; You seriously need to sanitise your data inputs to protect from SQL injection attacks. Use the mysql_real_escape_string[^] function.
$username = mysql_real_escape_string( $username );
$user = mysql_real_escape_string( $user ); Then use those sanitized values as your SQL inputs.
thebiostyle wrote:
echo "".$fetch_users_data->username."";
There is no need for the "" around the value. It will work just fine without it: echo $fetch_users_data->username;
thebiostyle wrote:
<body bgcolor="#000000" onload="$_GET['user']">
There is no need to have an onload attribute, with $_GET['user'] . It is also bad practice to use bgcolor. Use the style attribute instead, or better still use CSS classes.
thebiostyle wrote:
</div>
</table>
From what I can see you haven't opened a div; therefore there is no need to close one.
Note that you should also have a DOCTYPE which you should work from. http://www.w3schools.com/tags/tag_DOCTYPE.asp[^]
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Okay, everything is fixed, except the color issue... With the DOCTYPE, I think it fixed the colors, but now they're BG=black and FC=red, when they need to be BG=red and FC=black.....
BTW, the whole site is filled with errors, but it works for me, lol so it's okay. Though with the site being used for web design and computer graphic design, I will make sure not to include errors in any other page. Thanks!
|
|
|
|
|
I still need help with the color issue....
|
|
|
|
|
I'd really recommend removing all the bgcolor= stuff (and the span , center , b , u tags)and putting it into the style sheet. You can apply multiple classes to an element if you want to, you just need to separate them with spaces, like this:
<td class="alt dark">some stuff</td>
Where "dark" is your new class specifying the correct background and font colours:
td.dark {
background-color: #FF0000;
color: #000000;
font-size: 16pt;
text-align: center;
font-weight: bold;
text-decoration: underline
}
If you move all the style information into the style sheet it becomes a lot easier to spot problems in the PHP and HTML.
|
|
|
|
|
Thanks for all the help everyone!!
|
|
|
|
|
Hi friends !
I need to add two or three difference items with their information but I don't know how to do that.
Normal way, to put an item to shopping we just only create the button "Add to card" button and use the code from paypal as bellow.
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="sampleEmail@domain.com">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="ITEM 001">
<input type="hidden" name="item_number" value="001">
<input type="hidden" name="amount" value="1000.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
this code just only put one item to shopping card.
Now, for example, i got two difference items with their information :
Item one:
Item name:Item 001
price :10USD
item_number:001
Item two:
Item name:Item 002
price :20USD
item_number:002
Can anybody help me with sample code to put these two items to paypal shopping card !
Notes: I got these items and their information. I got a Checkout button.
Then anybody press to Checkout button, these two items will add to shopping card of Paypal(the result will the same as we click to the "Add to card" button of item one and then continue Shopping and click to the "Add to card" button of item two).
Thanks in advance !
|
|
|
|
|
A simpler method would be to use an associative array, like:...
cart[productid] = count;
filled in by the add to cart and then have the information sent to the paypal cart with the click of a second button, with a checkout button. The checkout would run a javascript to go through the array and and build the data the way that paypal likes it.
Of course there needs to be more involve with a shopping cart, cancel order button, back to shopping button, remove items button, etc, etc....
|
|
|
|
|
Hi !
Thanks for your reply , but that is not what i need.
IF your couldn't understand my question, im sorry because my english.
My question is: How to send data to paypal after we got information.
For Example, to send one item we use this code bellow.
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="sampleEmail@domain.com">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="ITEM 001">
<input type="hidden" name="item_number" value="001">
<input type="hidden" name="amount" value="1000.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
this code just only put one item to shopping card.
In my question i 'd like to send to shopping cart(paypal shopping card) two difference items with their information :
Item one:
Item name:Item 001
price :10USD
item_number:001
Item two:
Item name:Item 002
price :20USD
item_number:002
Have any ideas?
Thanks in regards
|
|
|
|
|
|
Dear cjoki !
Thanks for your reply.
This is what i need.
When i was waiting for your reply, i found another way to post items to paypal shopping card as following scribe bellow:
-Using client script(js) to post each form.
But this is not better than the way that you tell me.
for(var i=0;i<numberOfForm;i++){
document.form['orderOfForm'].submit();
}
Thanks in advance !
modified on Wednesday, December 30, 2009 9:26 PM
|
|
|
|
|
|
Hi there!
Need your help with:
Bigram probality of a sentence structure.
We can talk more if anyone email me back.
Best regards,
Shamim
The new pythian in town...
|
|
|
|
|
Okay, I was working on construction a Poll in PHP for the index page of my site, and came across these radio buttons of which ruin the vibe of the stylesheet.... They don't look good with the rest of the site. So I made four button "graphics" to use as the buttons... I will explain them, and add links to them.... just want you to help me on coding them into the page... to where I can copy and paste the code, and then save, and test the page and it should work like I have explained..... Thanks in advance...
So, The first button is the button each radio button should display once the page has loaded... here is the link... "First Button"
The second button should appear once the user hovers over the radio button... here is the link... "Second Button"
The third button is the button that shall appear once the user has clicked the radio button, and moved the mouse off it... here is the link... "Third Button"
The fourth button is the button that shall appear once the user has clicked on the radio button... here is the link... "Fourth Button"
Thank-You Very Much for your time and consideration. I hope to have this done today, so it can be up for Christmas... Thanks.
|
|
|
|
|