andrew_biggart
-
Posts
363 -
Joined
-
Last visited
-
Days Won
1
Posts posted by andrew_biggart
-
-
yea im using php but im just wondering do u use variables or ids or what so that after u log in it redirects you to the page u were viewing before you had to log in
-
can anyone tell me how to redirect to the page you were currently on, after you login???
-
This very very hard 2 do i am not an expert but try this !!!!!!!
http://www.phpeasystep.com/phptu/29.html
This should help let me know how you get on
-
Hey there il try and keep this short but basically i am designing an online clothing auction site and i would like to get the all item id's from my bids table that = my user id, and once i get all of the results i then want to get all the item info which is in a different table usuing the returned item id's from the bids table. Do i need to use 2 sql statements or what do i need to do ???
hope this makes some sense and thanks in advance
-
Can you give an example of a search and the entire result list? Is the search term comparable to all of the results?
well basically i am designing an online clothing auction for an assignment. Say i search for hat or coat or what ever all of the products i have stored in the database are shown !!!
-
Why are you resetting a POST value?:
$_POST['search']=addslashes ($search);
Should that be:
$search = addslashes($_POST['search']);
?
ok ive sorted this but it is still bringing up every product in the database ???????
-
il try that thanks dude
-
hi can anyone help me out with making a php search bar for my site, i have one at the moment and the code is as follows.
<?php
include("config.php");
$_POST['search']=addslashes ($search);
// Retrieve data from database
$sql="SELECT * FROM $tbl_name WHERE item_name LIKE '%$search%' ";
$result=mysql_query($sql);
// Start looping rows in mysql database.
while($rows=mysql_fetch_array($result)){
?>
<table class= "select_main"width="400" border="0" cellspacing="0" cellpadding="4">
<tr>
<td style="width: 40px"><? echo "<img src='images/". $rows['item_image'] . "' style='width:60px; height:80px;' />";?></td>
<td style="width: 313px"><? echo $rows['item_name']; ?></td>
<td style="width: 57px"><? echo $rows['item_starting_price']; ?></td>
<td><? echo $rows['end_date']; ?></td>
<tr/>
</table>
<?
// close while loop
}
// close connection
mysql_close();
this brings up every product in the database due to the wild cards i think. What am i doing wrong any 1????????
thanks in advance
-
hey everyone and thanks to anyone that can help me in advance!
At the moment i am designing an ebay type site for part of my coursework at uni. I am having trouble with two main things, the first thing being when ever my users log in i want to find out their user_id from the username entered and then after that when it goes to the myebay section bring up the relevent information relating to that user_id. I cant seem to get my head around it at all haha! im using a mysql database with useanme, password user_id fields etc! Any advice would be so much appreciated as has to be handed in on thur aghhhhhhh .
The second thing i would like help with if possible is when ever i add a product i can do this no problem, but the products i added directly into the database myself i have made the product name links to each individual product pages. Is there any way i can get php to convert the product name the user enters and make it a link. And then once this is done i would also to like it to create a unique page displaying its info on a larger scale like ebay. I have made the product page template so im wondering is there anyway to get php coding to create a new page for each product added usuing this template and then linking it to the product name (which it makes it a link) which is stored in the mysql database.
Im probably out of my depth i know but i am trying to fiqure it out so any help would be much appreciated.
sorry for the essay
tahnks again in advance for any help anyone can offer ;D
Redirecting after login ?????
in PHP Coding Help
Posted
ok i semi understand haha
rite im using the following codes
my check login code is
<?php
include ("config.php");
// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);
$row = mysql_fetch_assoc($result);
$userid = $row['user_id'];
$userav = $row['user_avatar'];
$name = $row['name'];
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file
session_register("myusername");
session_register("mypassword");
$_SESSION['myusername'] = $myusername;
$_SESSION['myuserid'] = $userid;
$_SESSION['myname'] = $name;
$_SESSION['avatar'] = $userav;
header("location:my_account.php");
}
else {
echo "Wrong Username or Password";
}
?>
and to check for my session im usuing this code at the top of each page !!!
<?php
session_start();
if(!session_is_registered(myusername)){
header("location:registration_page.php");
}
?>
how do i intergrate this new code into my existing one then ???
Thanks very much by the way !!!