Will Gresham 81 Master Poster

what are the file extensions? jpg, jpeg, JPG or JPEG?

Have you had a look at the source code of the HTML produced to see what it is actually outputting?

Will Gresham 81 Master Poster

The lines you want to change are opendir(".") , this tells it to look in the current directory (where the script is located) May be worth adding a variable for directory at the top with the attributes and replacing the "." with it, there are 2 instances of opendir, so replace "." with $directory or whatever you call the variable.

Will Gresham 81 Master Poster

Whats with the lack of quotes on there? Try this:

$strSaveTD = "<input type=\"button\" id=\"btnSave\" value=\"Save\" onclick=\"checkform($iMode, $iLevel, 1)\">";

As long as you escape the quotes it will work, the above will print the code as you would expect it to be in HTML (without the backslashes)

Will Gresham 81 Master Poster

If you are having issues with installation, post on the phpBB boards directly, probably get a faster response.

Will Gresham 81 Master Poster

The MySQL query would look something like this, also basic starting point:

// Basic query to find a relationship
$result = mysql_query("SELECT `status` FROM `relationships` WHERE `friend1` = '$user_id' AND `friend2` = '$friend_user_id' OR `friend1` = '$friend_user_id' AND `friend2` = '$user_id'")or die("Cannot select relationship, error:".mysql_error())
if(mysql_num_rows($result) != 1) {
  // No relationship in db or more than one relationship, show error
} else {
  // Work with the results
}

This is untested code off the top of my head, may need altering.

Will Gresham 81 Master Poster

Whats with the

session_start();
?>
<?php
if

You dont need the ?> and <?php there, it is likely that the line break after the ?> is causing the issue, remove the closing and opening tags altogether.

Also, you will want to look at your query, never put POST values into a query.. Sanitise them first otherwise you leave your script open to a very basic attack.

Will Gresham 81 Master Poster

8/10 first try, aparrantly Marley would do better

Will Gresham 81 Master Poster

If you mean a 'clock' which shows the current time without refreshing the page, PHP is not the place for you, try looking for Javascript clocks.

Will Gresham 81 Master Poster

Add a friends table to the database, with something along the lines of the following:
id: int - Unique ID, auto increment.
user1: int - ID of the user who sent the friend request
user2: int - ID of the user receiving the request
status: bool - Whether or not the request has been accepted

Query this table for records where user1 or user2 are equal to the logged in user ID.

Will Gresham 81 Master Poster

Think of it as a duplicate table to the forums, its similar - just a few changes:
Heres a very basic table:
message_id: int(10), auto_increment, primary - Message ID
message_from: int(10) - ID number of the user the message is from
message_to: int(10) - ID of the user the message is to
message_title: text - Title of the message
message_content: text - Message body
message_sent: int(11) - Timestamp of the date/time the message was sent

Thats probably the bare minimum you can get away with, when the user goes to view their messages, just search the db for records where the column message_to is equal to the id of the logged in user. You can expand it to add bool values for if the message has been read or replied to for example.

Also, looking at the structure of the tables you posted, it would be beneficial to change your datetime fields to int(11) and just store the timestamp in them. This can help with performance, especially on larger databases or if you search by these values.

Will Gresham 81 Master Poster

Since this would probably be against Adsense Policies, I doubt you will get any help.

Encouraging clicks

In order to ensure a good experience for users and advertisers, publishers may not request that users click the ads on their sites or rely on deceptive implementation methods to obtain clicks. Publishers participating in the AdSense program:

* May not encourage users to click the Google ads by using phrases such as "click the ads," "support us," "visit these links," or other similar language
* May not direct user attention to the ads via arrows or other graphical gimmicks
* May not place misleading images alongside individual ads
* May not promote sites displaying ads through unsolicited mass emails or unwanted advertisements on third-party websites
* May not compensate users for viewing ads or performing searches, or promise compensation to a third party for such behavior
* May not place misleading labels above Google ad units - for instance, ads may be labeled "Sponsored Links" but not "Favorite Sites"

Will Gresham 81 Master Poster

Looks like you are trying to use PHP as a client-side script, not possible. You will need to add Javascript or buttons to new pages to reload the questions as PHP is server-side and is compiled to HTML before being sent to the client.

Will Gresham 81 Master Poster

Are you sure the query is good? try replacing $query = mysql_query($sql); with $query = mysql_query($sql)or die(mysql_error());

Will Gresham 81 Master Poster

Well, your hosting company should have set the sendmail_path to the install dir of sendmail (unless you manage your own server) in which case it should be correct as the default value. The hosting company would be able to tell you if this was correct.

The sendmail_from will add a from to the mail headers if it was not specified in the mail() function.

Will Gresham 81 Master Poster

You can either echo the HTML tags echo "<some_tag>html</some_tag>"; If you do this the remember to escape your quotes with \s

Or another way:

<?php
// Some PHP code
?>
some HTML code
<?php
// Some more PHP code
?>
Will Gresham 81 Master Poster

RDNS is reverse DNS, generally used to detect spam email, but if not setup correctly will mean that emails will also be bounced from a valid source.

see http://en.wikipedia.org/wiki/Reverse_DNS_lookup#Uses

Will Gresham 81 Master Poster

Not sure exactly what you are asking, but in PHP redirection can be done as follows:

<?php
header("Location:http://www.somesite.com");
?>

and Meta:

<meta http-equiv="refresh" content="5; url=http://www.somesite.com">

this goes in the <head> tag

Will Gresham 81 Master Poster

Have you tried sending to another email address?

I assume you are using the standard mail() function. Also, check the host has RDNS correctly configured for the IP address(es) of the server.

Will Gresham 81 Master Poster

Best way to convert the dates:

// Get the data from the database
$new_date = strtotime($date_from_db);
// Insert the date back into the database

It would be worth checking the date is converted correctly before updating the db, if all your dates are in the same format then you should check a random 2 or 3.

Will Gresham 81 Master Poster

Make another column in the database and store a timestamp in it when the user logs in (much better than a formatted date anyway) and then work out this time yesterday

<?php
// Find out the timestamp for yesterday
$yesterday = time()-86400;
if($timestamp_from_db >= $yesterday) {
  // User logged in within the last 24 hours
} else {
  // User has not logged in within the last 24 hours
}

If you want to go further than 24 hours, add another 3600 to the 86400 for each 24 hours.

Will Gresham 81 Master Poster

Surely

$j = $rows+1;

should be

$j = $count+1;
Will Gresham 81 Master Poster

This will really depend on whether you can restrict what the user enters into the textarea. You need to decide where you will expect a new item (newline, comma-seperated, space seperated...) and then make sure the user follows the system, but people are known for not reading instructions.

Anyway, the below code should give you some idea of where to start (it is based on new values being on a newline):

<?php
// Get the data from the textarea and remove HTML entities
$textarea = htmlspecialchars($_POST['textarea_name']);

// Split the string up into an array of values
$dropdown_data = explode("\r\n", $textarea);

// Do some database stuff here.

// Output a dropdown
echo '<select name="dropdown_list">';
foreach($dropdown_data as $key => $value) {
  echo '<option value="'.$key.'">'.$value.'</option>';
}
echo '</select>';
?>

That will need adjustments for what you want to do, but it should give you some idea.

Will Gresham 81 Master Poster
Will Gresham 81 Master Poster

First it looks like you just lifted the javascript function from the website you quoted.

You have not defined a function called trailOn() or hidetrail().

There alot of scripts online you can download for free which will do what you are looking for, infact I have found a fair number of them from a keyword search from words in your post.

Will Gresham 81 Master Poster

Google is your friend, there are a multitude of editors available, people will have preferences. Just because someone likes an editor does not mean you will.

Will Gresham 81 Master Poster

As above, please use code tags and running the same query twice is pointless.

A few tips:
Do not trust your users, always check their input. Never use POST values directly in the database query, thats just asking for problems - look into mysql_real_escape_string() for starters.

There is a handy little piece of code which could probably answer this question for you:

or die('Error: '. mysql_error());

This will tell you if you have any problems in SQL queries, add it to the end of any query:

mysql_query("SELECT * FROM USERS WHERE login='$name'")or die('Error: '. mysql_error());

Going back to my first point here, you also are not encrypting the passwords. Lets say someone does gain access to the database (currently very easy with the SQL you are using) and gets the user list, I'm sure your userbase would not be happy that their password/email address combinations were out in the open. A simple md5('value'); creates an MD5 hash, thats some extra security for another 6 or so charaters of code.

Will Gresham 81 Master Poster

Seeing as you have the username already in a session $_SESSION['MM_Username'] = $loginUsername; , why not just use this in the query?

Will Gresham 81 Master Poster

also i suggest learning CSS. instead of using HTML styling

it will clean up your code immensely.

That and FONT tags were deprecated in HTML 4, so other than the fact that CSS is cleaner and reusable, to 'future-proof' applications, look into XHTML1/2 rather than HTML4

Will Gresham 81 Master Poster

They are both good to learn :)

Will Gresham 81 Master Poster

You can use regex in sql queries, although with what you are trying to do it may be simpler to keep this in PHP..

See this for regex in mysql:
http://dev.mysql.com/doc/refman/5.1/en/regexp.html

Will Gresham 81 Master Poster

Apart from the fact that your HTML could do with a lot of work, you do not need 2 session_start's, this should only in the file once.

Where is the value for $_SESSION set?

Will Gresham 81 Master Poster

Then post your code as there is obviously something wrong, if you are using isset, it will return true or false, no reason it will fail.

We can't help much without a base to start from ;)

Will Gresham 81 Master Poster

Did you start a session session_start() or did you just assign a session variable $_SESSION['someitem'] = 'somevalue'; ?

Try this to assign the session value:

<?php
// Start/register the session
session_start();

// Assign the variable
$_SESSION['logged_in'] = 'logged.in';
?>

And this to check the session:

<?php
// Check if the session exists and if it has a . in the value
if(isset($_SESSION['logged_in']) {
  // Check to see if the session value contains a period(.)
  if(preg_match('/([^]*?)\.([^]*?)/', $_SESSION['logged_in']) {
    // Redirect to logged in page
    header("location: pleaselogin.php");
  } else {
    // Do something else here
  }
}
?>

Code not tested, I think the syntax in the preg_match is correct, but check it first.

Will Gresham 81 Master Poster

You should always check the data just before it is entered into the SQL query, especially with POST and REQUEST values, so it is not a bad idea to check this twice (even though you are using sessions).

It may also be a good idea to restrict the characters in the username, so if you only want to have alphanumeric characters and select symbols then use preg_replace() to stop entry of anything else.

heenix commented: Spot on! +1
Will Gresham 81 Master Poster

If you decide to do that you will need to use Session/Cookie/POST data to tell the server what the product is, as you have have 2 or more products with the same name - this will cause issues if you just have the product name.

Send the product id as POST data or assign it to a cookie or the users session and run the query from there (of course, make sure you sanitize/clean the data before the query)

Will Gresham 81 Master Poster

I use NuSphere PhpED, one of the best programs I have ever used.

Also, shouldn't the title be 'editor' not 'software' :)

Will Gresham 81 Master Poster

I really can't be bothered to read your code fully if you can't be bothered to use

tags. (It does have a 'watermark' in the post boxes which tell you about the code tags)

But a quick glance shows this on your last lines:
[code=php]?<? include "layout/header.php" ?>

Whats with the extra ? there.

Will Gresham 81 Master Poster

To echo the values of the array you would need another foreach:

foreach ($final as $var) {
  echo "HTML code or other items " . $var;
}

You could also put the database query within the foreach so that it does it for each one.

Will Gresham 81 Master Poster

Try using an array:

foreach( $raw as $key ){
  $final[] = $key;
}

This will put each result into the array.

Will Gresham 81 Master Poster

When it goes to the transaction, the shopping cart has to be cleared so that when another user enters the website, the shopping cart will be empty for that user.

This does not look like a good idea, if I am understanding you then it would mean that everyone on the site would 'share' the cart...

Have a look at sessions, in your tables, add a column for 'session_id' or similar and use the session ID for this, this would mean that multiple users can have items in the cart at the same time and also would mean that once they click the checkout or pay button that you can remove only their items from the cart.

Will Gresham 81 Master Poster

If you were using the full MD5 hash then there would be a small chance for repition, however since you are only using the first 6 characters, this chance is greater.

You must the uniqe product ID be in the format you suggest? Would it not make more sense to have an 'id' column which is an auto-increment and also have a 'product_id' where you can put your fancy ID without fear of having duplicates.

If you really wanted to you could then index the product_id column and seacrh it, but this would not be the best idea as the IDs may not be unique..

Will Gresham 81 Master Poster

Just modify the code in my previous post with the columns you want in the table, obviously change $value to whatever you want to store in the array ;)

Will Gresham 81 Master Poster

Arrays are fairly simple, the below example is untested and is just a simple sample to show how it works:

$blind_details = array(
"width" => "$value",
"height" => "$value$value",
"material" => "",
"colour" => "$value",
"style" => "$value",
);

You can add more or less items to suit. Then to retrieve data you can do it multiple ways:
1.

echo $blind_details['height'] . "<br />";
echo $blind_details['width'];
etc...
// Would output:
// $value

2.

foreach ($blind_details as $key => $value) {
  echo $key . " is " . $value . ".";
}
// Would output:
// width is $value.
// height is $value.
// material is $value.
// colour is $value.
// style is $value.

Get the idea?

Will Gresham 81 Master Poster

Well, without your code we don't know what you already have. Post it up and someone will be able to help.

Will Gresham 81 Master Poster

Why are you asking how to convert txt files to PowerPoint (or any other for that point) files in a PHP forum?

Will Gresham 81 Master Poster

Do you mean $_SERVER['HTTP_REFERER'] ? you could get the domain which the user came to this page from from this variable, however this is not perfect, it can be spoofed and hidden quite easily.

Will Gresham 81 Master Poster

The image posted was done in Word, that's just a representation of what they want it to look like, when I say 3d effects, it more that alternating rows are inset/outset.

Will Gresham 81 Master Poster

I am having some problems with HTML and CSS, firstly with links in a li element, I have it set to display: block so that the it will highlight when the cursor is placed within the li area, but this is not working in IE 6 (I know this is a known issue in IE and I have managed to work around it before but I can't manage it this time)

/* Styles for the Drop-Down menus*/
#drop_menu {
  position: relative;
  float: right;
  z-index: 40;
  text-align: left;
}

#drop_menu li {
  margin: 90px 0 0 2px;
  list-style: none;
  float: left;         
}

#links_list li {
  margin: 0 13px 0 0;
  list-style: none;
  float: left;        
}

#drop_menu li a {
  display: block;
  text-align: left;
}

Any ideas on a work-round for this would be appreciated

Second, I have been asked to set the tables on the site out like the image attached, but I can't find out how to get a 3d effect on HTML tables (it will need to be XHTML 1.0 Strict and CSS2.1 compliant as the rest of the site is)
I have tried searching for this but with no luck so again any ideas appreciated.

Regards.

Will Gresham 81 Master Poster

Store the data in a database, get the clients to refresh/check the database at set intervals..

Will Gresham 81 Master Poster

I would not suggest showing E-Mail addresses at all ever on a website as these can be picked up by less than wholesome people :)

But if you really want to do this, echo an add the a mailto to the code around the email address.