Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Everything posted by phpretard

  1. Do you have an example of str_word_count. I am struggling to make it work.
  2. I use this structure all the time <head> </head> <body> <div id="main"> <div id="site_content"> <? include 'header.php'; include 'navigation.php'; include "pages/$page.php"; // DIFFERENT PAGES include 'footer.php'; ?> </div> '</div> </body> </html> // HERE IS THE NAVIGATION PAGE echo" <ul id='menu'> <li><a href='?page=home'>Home</a></li> <li><a href='?page=schedule'>Schedule</a></li> <li><a href='?page=pricing'>Pricing</a></li> <li><a href='?page=about'>About Us</a></li> <li><a href='?page=gallery&loc=gallery'>Gallery</a></li> <li><a href='?page=contact'>Contact Us</a></li> </ul>";
  3. I need some code that will validate a full name. Argument: 'John'=No Good | 'Doe'=No Good | 'John Doe'=Good if ($Name=='ONE WORD'){ $pass="No"; } if ($Name=='TWO WORDS'){ $pass="Yes"; } Anyone got an Idea
  4. I would look more into the connection error.
  5. $event=$_GET['event']; header( 'Location: http://www.website.com/index.php?page=checkout&event=$event' ); The redirect works but the address bar reads: http://www.website.com/index.php?page=checkout&event=$event' <---should be event=Sports I need the $event. It work throughout the site exept when a header redirect is used. Any thought?
  6. <?php if ($action=='delete'){ $file="P1040050.jpg"; unset($_SESSION[$file]['file']); } ?>
  7. How do I unset just one part of the array? unset($_SESSION[$file]['P1040050.jpg']); <--doesn't work $_SESSION:Array ( [P1040050.jpg] => Array ( [picture] => ALBUMS/Holmes_Adams/P1040050.jpg [file] => P1040050.jpg [s46] => 4 x 6 [QU46] => 10 [s57] => 5 x 7 [QU57] => 20 [s810] => 8 x 10 [QU810] => 30 [order_photo] => Order This Photo ) [P1040052.jpg] => Array ( [picture] => ALBUMS/Holmes_Adams/P1040052.jpg [file] => P1040052.jpg [s46] => 4 x 6 [QU46] => 30 [s57] => 5 x 7 [QU57] => 20 [s810] => 8 x 10 [QU810] => 10 [order_photo] => Order This Photo ) )
  8. Hey BrianM, Know anything about Multidimensional Arrays?
  9. I set it up and it worked. How about you?
  10. Did you put that code on a new page?
  11. That would be funny if I new what it meant. lol
  12. The onlt problem i saw was: if (mysql_num_rows($result) == 1) { Should be: $count=mysql_num_rows($result); if($count==1){
  13. Make a new file and put this code and only this code in it... Be sure --include '../tracking/db_connx.php';-- is still correct <?php session_start(); $errorMessage = ''; if (isset($_POST['Submit'])) { $username=$_POST['username']; $passwd=$_POST['passwd']; include '../tracking/db_connx.php'; $sql = "SELECT * FROM webusers WHERE username = '$username' AND passwd = '$passwd'" or die("error 1"); $result = mysql_query($sql) or die('Query failed. ' . mysql_error()); $count=mysql_num_rows($result); if($count==1){ echo"Loged In"; /* UNCOMMENT THIS LATER $_SESSION['db_is_logged_in'] == true; header('Location:../indexin.php'); exit; */ } else { $echo = 'Sorry, wrong user id / password'; } } ?> <p> <form id="login" name="login" method="POST" action=""> <input type="text" id="username" name="username" value="User Name" /> <input type="password" id="passwd" name="passwd" value="Password"/> <input type="submit" id="submit" name=Submit value="Log In"/> </form> </p>
  14. change the action="" to whatever it was...
  15. oh yeah...I also --selected * from table-- instead of just username
  16. I gave your submit button a name and used it for the isset <?php session_start(); $errorMessage = ''; if (isset($_POST['Submit'])) { $username=$_POST['username']; $passwd=$_POST['passwd']; include '../tracking/db_connx.php'; $sql = "SELECT * FROM webusers WHERE username = '$username' AND passwd = '$passwd'" or die("error 1"); $result = mysql_query($sql) or die('Query failed. ' . mysql_error()); if (mysql_num_rows($result) == 1) { echo"Loged In"; /* UNCOMMENT THIS LATER $_SESSION['db_is_logged_in'] == true; header('Location:../indexin.php'); exit; */ } else { $echo = 'Sorry, wrong user id / password'; } } ?> <p> <form id="login" name="login" method="POST" action=""> <input type="text" id="username" name="username" value="User Name" /> <input type="password" id="passwd" name="passwd" value="Password"/> <input type="submit" id="submit" name=Submit value="Log In"/> </form> </p>
  17. Can you post the form code?
  18. What happen when you try to log in? Blank page, Error, etc...
  19. I have read throught the post and still don't know the problem. I see that some problems were made. What was the original problem?
  20. Absolutely 100% I really need to know how to echo/print ---"ALBUMS/Holmes_Adams/P1040050.jpg"--- (within a foreach loop) from the two arrays. http://www.rememberthetimephotos.com/ALBUMS/Holmes_Adams/P1040050.jpg <-- picture path Don't mind the picture...It's kind of scary:)
  21. From a form. if(isset($_POST['order_photo'])){ $picture_id = $_POST['file']; foreach($_POST as $key => $val){ $_SESSION[$picture_id][$key] = $val; } }
  22. I can see where the problem lies but cant find the answer. Can anyone tell me why I can't see the pictures? echo '<pre>$_SESSION:' . print_r($_SESSION,true) . '</pre>'; The Above Yeilds This In The Browser: $_SESSION:Array ( [P1040050.jpg] => Array ( [picture] => ALBUMS/Holmes_Adams/P1040050.jpg //<----PICTURE 1 LOCATION [file] => P1040050.jpg [s46] => 4 x 6 [QU46] => 10 [s57] => 5 x 7 [QU57] => 20 [s810] => 8 x 10 [QU810] => 30 [order_photo] => Order This Photo ) [P1040052.jpg] => Array ( [picture] => ALBUMS/Holmes_Adams/P1040052.jpg //<------PICTURE 2 LOCATION [file] => P1040052.jpg [s46] => 4 x 6 [QU46] => 30 [s57] => 5 x 7 [QU57] => 20 [s810] => 8 x 10 [QU810] => 10 [order_photo] => Order This Photo ) ) foreach ($_SESSION as $file => $val){ echo"<img src='" . $_SESSION['picture_id']['picture'] . "'>"; } I was expecting 2 pictures to show up based on the session variables...all I get is an unidentified picture. I have been reading about this and can't pick up the answer anywhere.
  23. I just want to pull the information from the session --- $_SESSION['picture'] --- and use it for the source of an image.
×
×
  • 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.