Jump to content

sepoto

Members
  • Content Count

    254
  • Joined

  • Last visited

Everything posted by sepoto

  1. In the following code I check to see if 'logged_in' is defined. The code works great but I keep getting an error that 'logged_in' is not defined yet which I am well aware of. I do not see the fact the 'logged_in' is not defined as an error myself. Is there a work around. I really do not like to see errors and warnings. <?php session_start(); if(!$_SESSION['logged_in']) { echo "No user logged in."; } else { echo "User logged in."; }?>
  2. You are a great help. Thank you.
  3. <?php session_start(); if(!$_SESSION('logged_in')) { echo "No user logged in."; } else { echo "User logged in."; }?> Firstly I would like to check if a session is started yet before I call session_start(); but I don't know how to do that yet. Secondly when I am running this code $_SESSION('logged_in') is not defined yet which is as it should be however my code keeps turning up this error. Fatal error: Function name must be a string in C:\inetpub\wwwroot\dsg\login.php on line 3 I can't seem to figure out why this error is coming up.
  4. I have some code based on session_start(); and defining $_SESSION(''); variables. I looked at the session_start(); page on php.net but it does not really do a very thorough job of explaining things as far as the why's of things as opposed to the how's of things.
  5. I am looking for the easiest most streamlined way to implement a user authentication system to a website for a programmer that has experience with PHP. I looked into CakePHP but there seems to be too much fluff in it for me to want to use it. I just want user authentication or membership system code that I can implement.
  6. sepoto

    CSS Layout.

    "The element will generate a block box (a line break before and after the element)"http://www.w3schools.com/css/pr_class_display.asp
  7. sepoto

    CSS Layout.

    Changing the display property of the image to block does exactly what I want. The thing is is that I looked up the display property block and the manual defines a block element as having a space before and after the element. So where is the space after the element? Is the manual in error? <html><head> <style> body { text-align: center; min-width: 1000px; } #wrapper { text-align: left; width: 1000px; margin-left: auto; margin-right: auto; overflow: hidden; } </style></head><body><div id="wrapper"> <img src="img/masthead.jpg" style=
  8. sepoto

    CSS Layout.

    I am working with an image called masthead.jpg that is exactly 1000px wide. I notice that in the code below there is a small white space between the first image and second image that appears in Internet Explorer. I notice if I put a <br> directly after the first image the small white space gap actually disappears! How counter intuitive! <html><head> <style> body { text-align: center; min-width: 1000px; } #wrapper { text-align: left; width: 1000px; margin-left: auto; margin-right: auto; overflow: hidden; } </style></head><body><di
  9. sepoto

    Radio Button Group

    echo "<input type = 'Radio' Name ='radio' Value='" . $importdate . "' >"; I found out that if you call all of them radio that a call to $_POST["radio"] will return the Value of the one selected which in these cases is $importdate.
  10. sepoto

    Radio Button Group

    I have code that creates radio buttons in a form. Right now each radio button has a unique name. Is there not a way to make it so the radio buttons are grouped or something of that nature? <?phpmysql_connect('127.0.0.1','root','**********');@mysql_select_db('methane') or die( "Unable to select database");$query="SELECT DISTINCT import_date FROM planning ORDER BY import_date ASC";$result=mysql_query($query);$num=mysql_numrows($result);?><html><head><title>Select Data Set</title></head><body><form action="displaydata.php" method="post"><div sty
  11. sepoto

    strSQL (Insert Data)

    OK. It looks like this.function &db_connect() {if ($_SERVER['SERVER_NAME'] == 'tsg.someserver.net') { $myhost = "replace"; }else{ $myhost = "replace"; } $connUser = "root"; $connPass = "oilwell123"; $dbname = "thesportsguyz"; $db = new mysqli($myhost, $connUser, $connPass, $dbname); return $db;}
  12. sepoto

    strSQL (Insert Data)

    It is defined like this above at the top of the code.$db = db_connect();
  13. I am debugging some existing code in NetBeans. These are the lines I am working with: if($failed == false) { $pass_md5 = md5($password); $sql = "INSERT into dsg_users(company, first_name, last_name, street_address1, street_address2, city, state, postal_code, phone_number, fax_number, email, website, facebook, twitter, password, user_type) values( '$company', '$first_name', '$last_name', '$street_address1', '$street_address2', '$city', '$state', '$postal_code', '$phone_number', '$fax_number', '$email', '$website', '$fb', '$twitter', '$pass_md5', 1);"; $result = $db->query($sql); if(logIn
  14. sepoto

    The right editor

    I am trying to find an editor where I can select all my code and justify everything back to the left so that I can reformat all the code. I know how to write a script to do this myself I was just wondering if there is an editor that does that. Select all and move everything back to the left. Is there one?Thanks!
  15. I just read on php.net that split is being deprecated. How can this be? Does anyone know what is going to take the place of the split function?
  16. sepoto

    Random break line.

    Ahhhh!!! The min-height is what is doing it! I thought it was a line break! Thank you!
  17. sepoto

    Random break line.

    There is an actual break line after the table when I view in my web browser.
  18. sepoto

    Random break line.

    There is a break line right after the table and still inside the div with the parchment paper background. I don't really see how to remove it. Thanks very much for the help. <div style='width: 600px; min-height: 100px; border: solid 1px black; background-image: url(images/parchmentpaper-og.jpg); margin: 0; padding: 0;'> <table style='border: solid 1px black; width: 600px; margin: 0; padding: 0;'> <?php for($int=0;$int<sizeof($all);++$int) { if(sizeof($all[$int])>1) { echo "<tr>"; for($cnt=0;$cnt<sizeof($all[$int]);++$cnt) { echo "<td style='border:
  19. All good suggestions. I will try the compression as I think that is my best bet. Thank you.
  20. I have a JPEG that is 1MB in size. It takes a while to load so I was wondering how is the best way to optimize the image to speed how it loads? The image is a parchment paper background that I use for my guestbook.Thank you!
  21. There is no error message. Perhaps that is because my php.ini is set to be too permissive. Thank you very much for your reply.
  22. if($failed == false){ $sql = "select count(*) from dsg_users where email like '$email'"; $result = $db->query($sql); $row = $result->fetch_row(); if($row[0] > 0){ $msg .= "That email has already been registered"; $failed = true; } } It is noteworthy I think that at this point the table 'dsg_users' is empty. For some reason I am not sure of yet "$row = $result->fetch_row();" halts execution of the script. I believe that this script was written for PHP5.2. I always seem to get great guidance from this forum. Thank you.
  23. sepoto

    Use of header();

    Yes. I do believe all of that is correct. I will have another look at the code. Thank you for your help.
  24. sepoto

    Use of header();

    if(!$_SESSION['logged_in']) header("location:login.php?return=profile.php");//Set up if user's profile or if viewing a profileif(isset($_GET['uid']) && $_GET['uid'] <> "") $uid = $_GET['uid'];else if($_SESSION['user_type'] == 2) header("location:fan_profile.php");else $uid = $_SESSION['uid']; I am trying to decipher the meaning of what is inside the ""'s. Doesn't '?' Usually mean a parameter is being passed? header("location:login.php?return=profile.php");
  25. I'm going to have to check out the existing code and see what exactly is happening with the things you have replied with. It could be a long process. I'm trying to unravel some existing code from another developer.
×
×
  • Create New...