Jump to content

tet3828

Members
  • Posts

    107
  • Joined

  • Last visited

    Never

Everything posted by tet3828

  1. I put a auto login snippit at the begging of my script. some variables are passed from a flash projector to this page to set the user name and password. If I login with the correct username password stored in my database: [code]Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/t/e/t/tetunity/html/shell/data/index.php:7) in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 21 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/t/e/t/tetunity/html/shell/data/index.php:7) in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 21 Warning: mysql_result(): userName not found in MySQL result index 2 in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 36 You're logged in.[/code] when I login with an incorrect password username.... I included the html headers incase something up there is conflicting with my session login script [code] Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/t/e/t/tetunity/html/shell/data/index.php:7) in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 21 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/t/e/t/tetunity/html/shell/data/index.php:7) in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 21 [/code] [b]Please help if anyone has any ideas on how I could solve these errors and make this script properly. ???[/b] here is the script I am using. [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- a:link { color: #000000; } a:visited { color: #000000; } --> </style></head> <body> <center> <?php session_start(); session.cookie_lifetime(120);                \\\ NOT REALLY SURE WHERE TO PUT THIS SESSION TIMER!!! if (! isset($_SESSION['name'])) { if(isset($_GET['userName'])) { $userName = $_GET['userName'];                              \\\ I know I should use $_POST but macromedia flash projectors don't allow it. $userPass = $_GET['userPass']; mysql_connect("mysql213.secureserver.net","*****","*****"); mysql_select_db("*********"); $query = "SELECT nameFirst FROM users WHERE userName='$userName' AND userPass='$userPass'"; $result = mysql_query($query); if (mysql_numrows($result) == 1) { $_SESSION['name'] = mysql_result($result,0,"nameFirst"); $_SESSION['username'] = mysql_result($result,0,"userName"); echo "You're logged in."; } } else { include "verify.php"; } } else { $userName = $_SESSION['name']; echo "Welcome back $Username"; }[/code]
  2. I put a auto login snippit at the begging of my script. some variables are passed from a flash projector to this page to set the user name and password. If I login with the correct username password stored in my database: [code]Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/t/e/t/tetunity/html/shell/data/index.php:7) in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 21 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/t/e/t/tetunity/html/shell/data/index.php:7) in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 21 Warning: mysql_result(): userName not found in MySQL result index 2 in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 36 You're logged in.[/code] when I login with an incorrect password username.... I included the html headers incase something up there is conflicting with my session login script [code] Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/t/e/t/tetunity/html/shell/data/index.php:7) in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 21 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/t/e/t/tetunity/html/shell/data/index.php:7) in /home/content/t/e/t/tetunity/html/shell/data/index.php on line 21 [/code] [b]Please help if anyone has any ideas on how I could solve these errors and make this script properly. ???[/b] here is the script I am using. [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- a:link { color: #000000; } a:visited { color: #000000; } --> </style></head> <body> <center> <?php session_start(); session.cookie_lifetime(120);                \\\ NOT REALLY SURE WHERE TO PUT THIS SESSION TIMER!!! if (! isset($_SESSION['name'])) { if(isset($_GET['userName'])) { $userName = $_GET['userName'];                              \\\ I know I should use $_POST but macromedia flash projectors don't allow it. $userPass = $_GET['userPass']; mysql_connect("mysql213.secureserver.net","*****","*****"); mysql_select_db("*********"); $query = "SELECT nameFirst FROM users WHERE userName='$userName' AND userPass='$userPass'"; $result = mysql_query($query); if (mysql_numrows($result) == 1) { $_SESSION['name'] = mysql_result($result,0,"nameFirst"); $_SESSION['username'] = mysql_result($result,0,"userName"); echo "You're logged in."; } } else { include "verify.php"; } } else { $userName = $_SESSION['name']; echo "Welcome back $Username"; }[/code]
  3. so you would suggest.... doing away with my echo  and just using that header(location) command to go stright to the next page? would any of this information at the top of the page interfere with the header:location redirrect? [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Validation</title> </head> <body> <?php [/code]
  4. I have this simple script here: it validates a password/username and moves on to the database modification page (modify.php). I need it to move to the next page only if the password/username match.. (without the user having to click a link or okay button.) how would I do this? [code] if (******* == "".$_POST['userName']."" & ******* == "".$_POST['userPass']."") { echo "Username and password have been validated, thank you..."; echo "Entering Database"; [/code] so I would soppose the code to launch open the next page should be within my if brackets. Someone suggested putting a header & location at the top of the page. but I don't understand how that would complete the task.
  5. [code]if (******* == "".$_POST['userName']."" & ******* == "".$_POST['userPass']."") { echo "Username and password have been validated, thank you..."; echo "Entering Database"; [/code] after this simple validation script, what would be the best way to forward my user to the next page? (modify.php) without the user having to click a button or link. no variables need to passed in this situation.
  6. I thought I posted this topic a sec ago maybe a mod removed it or something? I don't know. anyway I am trying to get  the code within my div tags to display in a windowed area with vertical scroll bars. my current tags aren't working for some reason. Maybe they are the incorrect tags. Please help. I commented the line of code where I put the alledged div tags. [code] echo "<DIV id=\"scroll3\" style=\"width:500;height:350;overflow:auto; border: 1px solid\"><p><center>";   \\non-working div tags whats the problem? echo "<table border=3>\n" ."<tr>\n" ."<th>Item Picture</th>\n" ."<th>Name</th>\n" ."<th>ID #</th>\n" ."<th>Catagory</th>\n" ."<th>Price</th>\n" ."<th>Edit Link</th>\n" ."</tr>\n"; while($row = mysql_fetch_array($result)) { echo "<tr>\n" ."<td><center><img src=\"".$row['itemSmall']."\" height=\"75\" width=\"75\"  /></center></td>\n" ."<td>".$row['itemName']."</td>\n" ."<td>".$row['itemId']."</td>\n" ."<td>".$row['itemCat']."</td>\n" ."<td>".$row['itemPrice']."</td>\n" ."<td><a href=/shell/data/edit.php?id=".$row['itemId']." />Edit This Item</td>\n" ."</tr>\n"; } echo "</table>\n"; } echo "</center></center></p></DIV>";  \\\This should close the windowed area ?> [/code]
  7. I am trying to display a looooong table within a window containing vertical scroll bars. I've tried using div tags around the dynamic table. I set the tag diminsions to  500 width and 350 height. but for some reason instead of making a window with scrollbars it just creats a bounding box.. whats up with that? Am I using the wrong code? I commented near my existing tags [code]  echo "<DIV id=\"scroll3\" style=\"width:500;height:350;overflow:auto; border: 1px solid\"><p><center>";   \\\there is my non-working div tag. echo "<table border=3>\n" ."<tr>\n" ."<th>Item Picture</th>\n" ."<th>Name</th>\n" ."<th>ID #</th>\n" ."<th>Catagory</th>\n" ."<th>Price</th>\n" ."<th>Edit Link</th>\n" ."</tr>\n"; while($row = mysql_fetch_array($result)) { echo "<tr>\n" ."<td><center><img src=\"".$row['itemSmall']."\" height=\"75\" width=\"75\"  /></center></td>\n" ."<td>".$row['itemName']."</td>\n" ."<td>".$row['itemId']."</td>\n" ."<td>".$row['itemCat']."</td>\n" ."<td>".$row['itemPrice']."</td>\n" ."<td><a href=/****/****/****.php?id=".$row['itemId']." />Edit This Item</td>\n" ."</tr>\n"; } echo "</table>\n"; } echo "</center></center></p></DIV>";          \\\Closing div tag ?> [/code]
  8. The $result1 was a typeo. I've changed it to $result if you look at my last script posting you'll see the change. I didn't post the script right away. here it is again: [code] while($row = mysql_fetch_array($result)) {   \\\ I somewhat understand the loop concept but, I don't understand the condition here..... echo "<table border=3>\n" ."<tr>\n" ."<th>Item Picture</th>\n" ."<th>Name</th>\n" ."<th>ID #</th>\n" ."<th>Catagory</th>\n" ."<th>Price</th>\n" ."<th>Edit Link</th>\n" ."</tr>\n"; while($row1 = mysql_fetch_assoc($result)){           \\\ Nor here. echo "<tr>\n" ."<td><center><img src=\"".$row['itemSmall']."\" height=\"75\" width=\"75\"  /></center></td>\n" ."<td>".$row['itemName']."</td>\n" ."<td>".$row['itemId']."</td>\n" ."<td>".$row['itemCat']."</td>\n" ."<td>".$row['itemPrice']."</td>\n" ."<td><a href=/****/****/****.php?id=".$row['itemId']." />Edit This Item</td>\n" ."</tr>\n"; } }} echo "</table>\n"; [/code] Oh boy I am a forum regular now....ugh that happened quick.
  9. The last reply seems to be on the right track. however my search results aren't displaying properly. its only show one result. lets say I search for items in the holiday catagory. I know for a fact I have 2 items where itemCat = "Holiday" but only one is showing. why would this happen? the code: [code] while($row = mysql_fetch_array($result)) { echo "<table border=3>\n" ."<tr>\n" ."<th>Item Picture</th>\n" ."<th>Name</th>\n" ."<th>ID #</th>\n" ."<th>Catagory</th>\n" ."<th>Price</th>\n" ."<th>Edit Link</th>\n" ."</tr>\n"; while($row1 = mysql_fetch_assoc($result)){ echo "<tr>\n" ."<td><center><img src=\"".$row['itemSmall']."\" height=\"75\" width=\"75\"  /></center></td>\n" ."<td>".$row['itemName']."</td>\n" ."<td>".$row['itemId']."</td>\n" ."<td>".$row['itemCat']."</td>\n" ."<td>".$row['itemPrice']."</td>\n" ."<td><a href=/shell/data/edit.php?id=".$row['itemId']." />Edit This Item</td>\n" ."</tr>\n"; } }} echo "</table>\n"; [/code]
  10. I gave the suggested script my best shot and Im getting mysql errors: The script is no longer displaying results. any suggestions? [code] if ($cat  != "nocat") { $qry = "SELECT itemName,itemId,itemPrice,itemSmall FROM `products` WHERE itemCat='".$_POST['cat']."'"; $result = mysql_query($qry) or die(mysql_error()); $amount = mysql_num_rows($result); echo "<br /><br />";} while($row = mysql_fetch_array($result)) { echo "<table>\n" ."<tr>\n" ."<th>Item Picture</th>\n" ."<th>Name</th>\n" ."<th>Price</th>\n" ."<th>Edit Link</th>\n" ."</tr>\n"; while($row1 = mysql_fetch_assoc($result1)){ echo "<tr>\n" ."<td><center><img src=\"".$row['itemSmall']."\" /></center></td>\n" ."<td>".$row['itemName']."</td>\n" ."<td>".$row['itemPrice']."</td>\n" ."<td><a href=/*********.php?id=".$row['itemId']." />Edit This Item</td>\n" ."</tr>\n"; } echo "</table>\n"; }} [/code]
  11. Thanks once again for the response. it's a way better approach to my problem. I soppose I will be able to intergrate into my script but I'll need a bit more help comprehending this script. I understand the: [code] <tr>  </tr> <td> </td> [/code] concept. of course it signififyies the opening and closing of a row and columns but what is the function of: [code] <th> </th> and the \n ??? [/code] note I am researching my question on google. but nothing beats a personal break down from a php whiz. thanks. hope someone can help.
  12. Here is a tricky one. At least I think. My script currently returns database search results. The information is displayed as a table with a thumbnail, item Name ect. Because this information is in a table; the results are stacked upon eachother vertically. This is going to cause a problem for the user. I tried to come up with a loop dohickey that will display each table inside of a dynamic table so the results can be displayed within a cell. I gave it a shot and tried many variations of it but no luck. where has my script gone wrong? [code]      noresults = mysql_num_rows($result);      $columns =  3;      $rows = $noresults / $columns;      $rows = ceil($rows);      $i = 0;      print ('<table width="100%" border="1" id="content_list">');            while($row %3[/code]
  13. ***bump*** sorry still unsolved. ???
  14. That last suggestion didn't quite do the trick. I even double checked to see if the descvalue was passed properly. anymore suggestions as to why this query would yeild no results? $qry = "SELECT itemName,itemId,itemPrice,itemSmall FROM `products` WHERE itemDesc OR itemName OR itemId LIKE \"%$descvalue%\"";
  15. >:( I swear this query was working a little while ago. Any suggestions as to why a search would yeild no results when I know for sure the posted form value for %descvalue is in my database?? $qry = "SELECT itemName,itemId,itemPrice,itemSmall FROM `products` WHERE itemDesc OR itemName OR itemId like \"%$descvalue%\""; $result = mysql_query($qry) or die(mysql_error()); $amount = mysql_num_rows($result); echo "<br /><b><a href='http://claireart.net/shell/data/index.php'>Click Here</a></b> to try a different search.<br /><br /> "; while($row = mysql_fetch_array($result)) { echo "<table border=\"1\"><tr><td>".$row['itemName']."</td></tr>"; echo "<tr><td><center><img src=\"".$row['itemSmall']."\" /></center></td>"; echo "</tr><tr><td>Price: $".$row['itemPrice']."</td>"; echo "</tr>"; echo "<tr><td>"; echo "<a href=/shell/data/edit.php?id=".$row['itemId']." />Edit This Item</a>"; echo "</td></tr>"; echo "<br>"; echo "<br>"; } echo "</table>";
  16. Almost there! the Dynamic form is [i][b]almost[/b][/i] ERROR free. Thanks once again [b]Orio you're a Genius[/b]! Thanks once again for all the time you devote to this fourm The only problem I am having now is: the loop is displaying one extra line in my dripdown menu. The extra line is blank. What is causing this? and how can I eradicate it? echo "<select name='newName'>"; echo "<option value='1' selected>Select a Catagory</option>"; echo "<option value=\"cat".$row['itemCat']."\">".$row['itemCat']."</option>\n"; $result = mysql_query("SELECT itemCat FROM `products`");  while($row = mysql_fetch_array($result)) {     echo "<option value=\"".$row['itemCat']."\">".$row['itemCat']."</option>\n"; } echo "</select>"; echo " <input type='submit' name='submitfour' value='Submit' /><br /><br />";
  17. Maybe my question was misunderstood or my script is inncorrect. for my 'products' database is setup as follows: each "product" has "itemName, itemDesc, itemCat..... I was hoping to have a dropdown menu filled with ANY values that maybe listed in the itemCat column. for example even if I went to myphpadmin and added a new item with a new catagory that catagory would appear in my dropdown. for some reason this script isn't populating my dropdown with anything other then the "select a catagory" option. any suggestions as to why this might be happening???? echo "<select name='newName'>";       echo "<option value='1' selected>Select a Catagory</option>";       echo "<input type='submit' name='submitfour' value='Submit' /><br />";         $result = mysql_query("SELECT itemCat FROM products");       while($row = mysql_fetch_array($result)){ echo "<option value=\"".$row['itemCat']."\">".$row['itemCat']."</option>\n";           }
  18. what would cause these lines to have a Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/t/e/t/tetunity/html/shell/data/edit.php on line 202???     while($row = mysql_fetch_array($result)){ echo "<option value=\"$row['itemCat']\">$row['itemCat']</option>\n";     }
  19. In the following script...Why did the coder Leave PHP ?> Make the <select> statement and go back into it <?php? would this code still work if it stayed in PHP and used the echo "<select name="blah">.....??? <?php php require("config.php"); $result = mysql_query("SELECT * FROM spell"); ?> <select name="wordlist"> <option value="1" selected>Select Word</option> <?php    while($row = mysql_fetch_array($result)){       echo "<option value=\"$row['words']\">$row['words']</option>\n";    } ?>
  20. Im looking to populate a drop down menu with whatever value maybe in a column of my SQL database. example: in my 'products' database  itemCat (item catagory) maybe Holiday, Beauty, Cosmetic,ect. How would I make each of these values show in my dropdown box? or would it be better to use radio boxes?
  21. Im a noobie to but this worked for me: (this code needs to be within the <?php ?> brackets) echo "<a href=yoururl.php?id='$varaibleYouWantToPass' />type your link text here</a>"; yoururl.php is where you put the location and file name you want to pass your data to. $varaibleYouWantToPass is the varaible you want to pass.
  22. What sort of data are you trying to submit? Where do you want the data to be sent to? a different page or the one you are working on?
  23. Im new to this myself but I'd start by making yourself a database in mySQL. As far as the thumbnails you would either have to use Photoshop to run a batch conversion on all the images you need OR get some sort of 3rd party script that makes thumbnails for you.
  24. start by creating a database in PHPMyAdmin. Im pretty new at this too. but I'd say make a table with 3 columns to start. One column for the number. one for the name and one just to have as an extra.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.