gpdrums 0 Light Poster

Hi All:

I'm connecting to a db to populate a table. My code loops through the db without errors. The problem is in Firefox, my rows of data display as individual tables. Everything works perfect in IE. Any ideas what I'm missing? The table population code basically looks like this:

<?php
echo "
<table>
<tr>
<td>$col1</td>
<td>$col2</td>
<td>$col3</td>
</tr>
</table";
} echo ">";
?>

Also, if I place the ">" inside the curly bracket to close the table tag, IE displays each row as a table. So, echoing the ">" after the curly bracket fixed that problem. I've been coding for 9 hours, so I'm sure I'm just missing something obvious.

Thanks for the help!

gpdrums 0 Light Poster

I'm working on an if else statement that will display a custom link for everyone except Company A. Everything below works just fine, but it's imperative Company A not see the first link.

I've tried something along the line of:

<?php
$nolink = "Company A";
if ($_SESSION['company'] != $nolink);{ //display the link...etc
?>

...but the problem is, my custom link has nested php scripts. I think I'm on the right track, but I'm stuck. Again, my code below works except that I want the first link to disappear for Company A.

<h1>Welcome, 
<?php //display company name inside the h1 tag
if (!session_register(company));{
echo $_SESSION['company'];}
?>
</h1>

<p>
<!--DISPLAY THIS LINK FOR EVERYONE EXCEPT COMPANY A-->
<span style="margin-left: 50px;">
<a href="<?php  echo "folderName/" . $_SESSION['company'] . "/" ?>">&raquo; Go To <?php echo $_SESSION['company'];?> Account Info</a>
</span><br />

<!--DISPLAY THESE LINKS FOR EVERYONE-->
<span style="margin-left: 50px;">
<a href="link2.php">&raquo; Go To Link 2</a>
</span><br />
<span style="margin-left: 50px;">
<a href="link3.php">&raquo; Go To Link 3</a>
</span>
 </p>
gpdrums 0 Light Poster

I want to redirect authenticated users to a personal account page where they will see links to pdf documents in their folder.

1. How do I perform this redirect?
2. How do I call the file names for the documents in the account folder?

Thanks much!

gpdrums 0 Light Poster

As I continued to play with the code, I added "Welcome, " to the echo() statement. I noticed that if the person was not logged in, "Welcome," printed without the company name. What type of else statement will keep this from happening?

gpdrums 0 Light Poster

Update: This worked. Thank you for the help. FYI, here's what I did to echo the company name on the appropriate pages:

<?php
if (!session_register(company));
{
echo $_SESSION['company'];
}
?>
gpdrums 0 Light Poster

Thank you for the replies. I will have to continue this Friday or next Monday due to other web obligations.

With regard to the php version, we are self-hosting. I can reconfigure Apache if need be, but what I'm doing works--and if it aint broke, don't fix it! Right?

One more thing: I have to try out the code you both provided to see how it goes, but if I want to echo the company name on any page while the session is active, what do I need to do?

Thank you again for helping me here. I'll return the favor as often as I can.

GP

gpdrums 0 Light Poster

Hi Kishore,

Problems between compliant and non-compliant browsers are well-known and well-documented--meaning. What this means is Mozilla follows W3 Standards while Microsoft follows Microsoft standards.

Most of the time, these glitches can be fixed by using external style sheets specific to IE browsers. In other words, you would have a default style sheet, but when IE5, 6, or 7 is encountered, that particular style sheet would be called.

Here's what the code might look like:

<link href="style.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="style-ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if IE 6]>
<link href="style-ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->

One thing to keep in mind is you only have to change the CSS for the particular element that is not aligned properly. So, the user will always use the default style sheet, but if the user has IE6, for example, maybe the font size for the <h1> tag needs to be smaller--and that change is all you will need to include on the IE6 style sheet.

Hope this helps.

gpdrums 0 Light Poster

Hi All:

I have an extensive website in which I would like to echo the name of the company various pages after the user logs in. I think I should be using the $_SESSION global, but I'm having difficulty implementing it, placing it in my code, and knowing what php code to place in the pages where I want the company name to appear. From what I understand, I need to fetch the company name and assign it to the session while the user name and password are being authenticated.

For purposes of this question, the MySQL table is laid out as follows:

[LIST]
[*]id
[*]username
[*]password
[*]usergroup (not being used yet)
[*]company
[*]last_login
[/LIST]

Here's my check-login code:

<?php

  $host = "---";
  $username = "---";
  $password = "---";
  $db = "---";
  $tbl_name = "---";

// Connect to server and select database.
mysql_connect($host, $username, $password) or die("Unable to connect to database.");
mysql_select_db($db) or die("Unable to connect to database.");


// Username and password sent from form.
$myusername = mysql_real_escape_string($_POST['myusername']);
$mypassword = mysql_real_escape_string($_POST['mypassword']);


$sql = "SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result = mysql_query($sql);

// 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 "login_success.php"
  session_register("myusername");
  session_register("mypassword");

// Update the last_login field of the MySQL database
$lastlogin = mysql_query("UPDATE $tbl_name SET last_login=now() WHERE username='$myusername'");

// Redirect good login attempt
  header("location:login_success.php");
  }

// Redirect bad login attempt …
gpdrums 0 Light Poster

Do you have a Google webmaster account. If not, get one. Build your xml site-map and submit it to Google.

gpdrums 0 Light Poster

Joe, thank you. That makes mucho sense and I'm def on the right track. I can't try it out til tomorrow, but I'll post back and let you know. ~gp

gpdrums 0 Light Poster

I highly recommend researching this topic before securing a domain name.

First of all, if you go to certain domain name search engines, you're likely to end up having to purchase that domain name from a company you don't prefer at a possibly unreasonable price. Whatever you do, resist the urge to search for available domain names until you know you are ready to purchase and build. Try to buy the domain from your preferred hosting company.

If you are going to build your own website and you have zero experience, I'd recommend yahoo as a good place to start and learn. Other folks might disagree, but there are some benefits to hosting a new site with a giant search engine company. Plus, they have some easy-to-use commerce features.

If you have web design experience, search for the best deal on hosting and purchase your domain from the same company. You don't have to, but it's fewer headaches. The company I use quite often costs $45 for domain name and 1 year hosting and comes with 20GB monthly bandwidth, plenty of storage, unlimited email addresses, and so on. Subsequent years are $6/mo/yr. There are many good companies from which to choose; just look around.

Finally, if you are going to have your website built by an agency, you might as well just buy your domain through them. If you pre-purchase from somewhere else you will probably pay a fee to transfer the domain to their servers …

gpdrums 0 Light Poster

Hi All,

Using php and MySQL, I completed a login session script and it works great. I am assigning the username and password to select users, and there will be no registration form.

My "users" table in MySQL has 5 columns as follows:

  • id
  • username
  • password
  • company
  • last_login

I need help with two things:

  1. How do I INSERT datetime to the MySQL db from the php login script?
  2. How do I echo the company name on every page of the website whether or not the page contains protected content?

The session_start() is on every page. Protected pages contain an authentication script after the session_start(). My authentication script does not verify the company name, but I want to display the company name upon session register for the duration of the session. Obviously, session_destroy() will terminate display of the company name.

Thanks for the help.

gpdrums 0 Light Poster

Thank you for taking the time to explain this further. I need to absorb it over the next few days. I just might take you up on digging up some code, but I'll not pester you if at all possible.

I'll go ahead and close this one as solved, but you might get an im from me.;)

By the way, I was in Asia last week and I drank quite a bit of tea.

gpdrums 0 Light Poster

1. Write a cookie/session-login. Write the functions in a smooth lib so that you can be sure that they are working correctly - and if not rewrite them eith ease.

This part is not a problem. Thank you!:)

2. Create a DB with all information you need for you (your company) and your customer. Write an output for these data (for the customer) and an input (for you company to edit and add new stuff).

This db will consist of multiple tables for different types of documents. The db will be populated by a mainframe (a different programmer is taking care of that part). But lets just say we have only one table with a link to a document in a folder; in that case, I want the user to log in and see only his documents.

For some reason, my brain isn't grasping how to connect to the db and display the documents of a particular user while leaving the documents of another user unavailable...
I'm thinking each user's docs must be stored in separate folders on the server, but that's as far as I can get. I'm missing a php function in my concept.

Also, is an index.php redirect sufficient to keep a folder containing said documents reasonably secure?

5. Lay back and drink a strong coffee, 'cause you did it.

Join me!

gpdrums 0 Light Poster

I'm looking for a php/mysql customer service module that will do two things:

  1. manage user login/session without self registration
  2. allow customer to download document packages in pdf

Our customers are overseas. We want to provide documents to them online to save document shipping costs. Ideally, I will provide the customer with a user name and password. Once they login, the page will populate with pdf links from a mysql table.

I've been searching sourceforge but I haven't found anything yet. Any tips from this supportive community would be greatly appreciated.

gpdrums 0 Light Poster

I'm searching for a php script featuring real-time currency exchange rates.

Does anyone know of a working script that automatically updates 24/7?

1st preference is a scroller.

2nd preference is a chart like the one at bloomberg: http://www.bloomberg.com/markets/currencies/fxc.html

Any help or ideas would be much appreciated.

gpdrums 0 Light Poster

Hi ya'll!

The problem is only IE 6. When I mouse-over from left to right the 2nd level links display properly. However, when I mouse-over from right to left the 2nd level links stack up.

In other words... display: inline; ...won't work in IE6 when I drag the mouse right to left.

I am not able to upload an example, sorry, but has anyone seen this before?

gpdrums 0 Light Poster

I'm an intermediate student of php/mysql. I want to develop a system that allows the client to login and view physical documents related only to their account. My intention is to provide the client the user login id and pass. However, in addition, I want to be able to allow non-clients to register and view info not available to non-registered users.

  1. How many different database/table components and functions will be involved?
  2. Has anyone here done this before?
  3. What book or website specifically addresses developing this level of web application?

I want to keep it simple but I don't want to leave anything out as far as security is concerned. I've got a few months to put this together.

Thanks!

gpdrums 0 Light Poster

Thank you Midi!

gpdrums 0 Light Poster

After cropping 1px off the edge of the corresponding tab image, the final straw so far as I'm concerned, I have decided, indeed, your computer is more cleverer.

I think I'll let this one go to rest.
Thanks everyone!

gpdrums 0 Light Poster

I attached a screen shot. The funny thing is I have checked for this glitch on no less than 10 different computers.

The navigation is straight CSS / HTML - the line only appears in FireFox on a wide screen monitor.

Dare I throw in the towel? Thing is - this glitch might really be something. We could win an award for discovering and correcting it, right?;)

gpdrums 0 Light Poster

The white box would indicate I'm taking a break. LOL I decided to make that div black right when I was calling it a night.

As far as the 1px line is concerned, I have the "HOME" selected. Right when you land on the page, a 1px line appears to the right of the curved box, but only in Firefox. As soon as you hover over something, the line disappears. However, if you scroll down the page then come back up, the 1px line resets.

All that said, I wonder if it is related to wide screen resolution.

Thanks for taking a look anyway.:)

G

gpdrums 0 Light Poster

I'm hoping someone can help me figure this out.

The main navigation menu shows a 1px white line to the right of the current selection - only in Firefox - only on first load - and clears itself after the mouse hovers over another part of the menu.

I can't figure out if it is an image problem or a CSS problem.

Here's the temporary site: http:// 30bands30hours. kerntechsupport. com (Remove the spaces please!)