buddylee17 216 Practically a Master Poster

I will restrain from lecturing on normalization. I assume you've probably never heard of it but I'd highly recommend looking into it.

What does your insert look like?

buddylee17 216 Practically a Master Poster

Count is an aggregate function. It's not going to return anything from the database. It's only going to count the number of records matching your criteria and return the total.

buddylee17 216 Practically a Master Poster

If you have phpmyadmin, you can also upload the csv through it.

buddylee17 216 Practically a Master Poster

Here's a possible solution.
Step 1, Create an empty array.
Step 2, Evaluate each checkbox in a loop. If empty, push a 0 into the array. Else, push a 1 into the array.
Step 3, Implode the array using a comma as the "string glue":

<?php
if(isset($_REQUEST["submit"])){
$checkarray = array();
$numCheckBoxes = 5; //number of checkboxes to evaluate
	for($i=1; $i<=$numCheckBoxes;$i++){	
		if(empty($_REQUEST["check".$i])){
		array_push($checkarray,0);
		}else{
		array_push($checkarray,1);	
		}
	}
$checkstring = implode(",",$checkarray);//create comma separated string from array
echo $checkstring;//outputs:1,0,1,1,0 
}
?>

This code assumes that the checkboxes are named check1,check2,check3,check4,check5...

darkagn commented: nice suggestion +4
buddylee17 216 Practically a Master Poster

Well you have to come up with some type of criteria for the script to decide which folder to choose.

buddylee17 216 Practically a Master Poster

elseif implies that you have multiple conditions to check. Example:

<cfif color is "green">
     <cfset colorscheme = "white">
<cfelseif color is "blue"><!---Notice how there is a statement after elseif. You can't just use <cfelseif>--->
     <cfset colorscheme = "black">
<cfelse>
     <cfset colorscheme = "red">
</cfif>

Honestly, you have two elseif statements that do the exact same thing. In that case, you could just use else and get rid of the second elseif:

<cfset today = NOW()>

<cfif not isDefined("Form.fileupload") OR Form.fileupload EQ "">
<cfquery datasource = "technology">
INSERT INTO sharex_2007
VALUES('#Form.title#', #CreateODBCDateTime (Form.date#, '#Form.presenter#', '#Form.group#', '#Form.remarks#', '#Form.ClientFile#', #Form.audience#)
</cfquery>

<cfelse>
<cffile action="upload"
filefield="fileupload"
destination="d:\intranet_info\sharing\shared_x\newsharex\2007\"
nameconflict="overwrite">

<cfquery datasource = "technology">
INSERT INTO sharex_2007
VALUES('#Form.title#', #CreateODBCDateTime (Form.date#, '#Form.presenter#', '#Form.group#', '#Form.remarks#', '#Form.ClientFile#', #Form.audience#)

</cfquery>
</cfif>

Also, to keep things neat in the future, wrap your code in code tags like so:

[code=Coldfusion] <cfset var = 2>

[/code]

And it will look like this:

<cfset var = 2>
buddylee17 216 Practically a Master Poster

You could use a meta refresh or JavaScript's window.location. Both are used by DaniWeb during login (depending on whether or not you have JavaScript enabled).
Login. When you get to the page that says "Thank you for logging in, rajeesh_rsn. Click here if your browser does not automatically redirect you." click view-> source to see how it's done.

buddylee17 216 Practically a Master Poster

Adobe Flash, JavaScript, HTML 4.01 Transitional, CSS, and PHP.

Yeah he probably is promoting his site, but the links on DaniWeb are no-follow, so it wont improve the Search Engine rank.

buddylee17 216 Practically a Master Poster

Echo the variable into the xml.

<?php $imagea= 'http://localhost/personal_trainer_system/images/Bench.jpg'?>;

myImage['blue'] = new Image();
myImage['blue'].src = <?php echo $imagea; ?>;
buddylee17 216 Practically a Master Poster

You'll either have to give the xml file a .php extension, or set Apache to parse php in xml files. This can be done with the http.conf file or with a .htaccess file. If you don't have access to the server, .htaccess may be the only way for you to do this.
After setting the server, you'll then be able to make the xml file dynamic by adding the necessary php scripts.

buddylee17 216 Practically a Master Poster

I've always found that email clients remove quotes from attribute values and some, like hotmail, actually change the values. The only solution that I've found is to not surround values in quotes. Clients have so many techniques to weed out spam and malicious messages, html emails can be tricky.
Also, the php mail function will work fine with a contact form on your site that submits to an address on your server MX. But if you try to send the mail to a major mail server like hotmail or gmail account, it's probably going to wind up in the junk folder (at best). The mail function lacks SMTP authentication and thus most clients are going to flip it the bird. If your serious about html email, you should start with a class that includes SMTP, like phpmailer.
As for forms in an email, I doubt that will fly with many email clients. Keep the form on the site and send a link to the form through email.

buddylee17 216 Practically a Master Poster

By default, divs are block level elements, and won't allow other elements to lay next to them. You can fix this by setting the inner divs style to either float:left and float:right, or you can use display:inline for both. If you use display:inline, make sure that the sum of the width of your inner divs is slightly less than your main div.

buddylee17 216 Practically a Master Poster

Change your css back to what you had before and then add this:

ul ul{
padding-left:20px
}

Adjust the padding to your needs.

buddylee17 216 Practically a Master Poster

Your code is correct. The problem is the * in the css. Particularly the padding. With

* {
margin: 0;
padding: 0;
}

you've reset the padding of all elements to 0. By default, the browser adds padding-left to the second list. However, you've reset the padding to 0, so the list doesn't get the padding. Delete padding:0; from the * element css and you'll see your list get padded properly.

buddylee17 216 Practically a Master Poster
buddylee17 216 Practically a Master Poster

How much are you willing to spend?

buddylee17 216 Practically a Master Poster

There are several ways to do this. The easiest would probably be to use the session array to keep up with the option values. You could also set a cookie with javascript.

buddylee17 216 Practically a Master Poster

Use substr function. Note, I also used strpos in the example to ensure that the last word isn't broken up.

<?php
$str="The quick lazy fox jumps over a lazy dog.";
$space=" ";
$sppos=strpos($str,$space,10);
$str=substr($str,0,$sppos);
$str.=" ...";
echo $str;
?>

Example without strpos:

<?php
$str="The quick lazy fox jumps over a lazy dog.";
$str=substr($str,0,14);
$str.=" ...";
echo $str;
?>
buddylee17 216 Practically a Master Poster

There is no such attribute value as "float:center". Only left and right.

buddylee17 216 Practically a Master Poster

You're on the right track. You'll need to create an anchor for the page to go to.

In the html where you want the page to scroll to, add <a name="bottom"></a> The page should scroll to here after submit.

buddylee17 216 Practically a Master Poster

Add captcha to keep the bots out

buddylee17 216 Practically a Master Poster

Sometimes it's easier to tell php which html to send to the client, based on a condition. Simple example:

<?php
$show="invalid";
if($show=="valid"){
?>
<div>You get to see this content</div>
<?php
}else{
?>
<div>Error: Access Denied</div>
<?php
}
?>

In this example, the only thing outputted to the client would be "Error: Access Denied".
So you could do something like this:

$result = mysql_query("SELECT * FROM clients WHERE clientID=$_POST[clientID]");
$num_rows = mysql_num_rows($result);
if($num_rows>0){
while($row = mysql_fetch_array($result))
  {
  print "Hi";
  echo(" ");
  echo $row['firstname'] . " " . $row['surname'];
  echo(" ");
  echo("welcome back you can change your booking using the form below  ");
  echo "<br />";
  }
?>
<form>
<table>
<tr><td>Form stuff here</td></tr>
</table>
</form>
<?php
}else{
?>
Error: The client ID is invalid. Please click back button and try again.
<?php
}
?>
</body>
</html>
buddylee17 216 Practically a Master Poster

Constructive criticism (the page looks good):
Forget about the video. Try to trim some of that bandwidth down.

You guys must have some dedicated fans, to wait on that page to load. More is not always better. If a fan visits the page with dialup (approximately 40 kb/s), it's going to take him/her 25 seconds just to download that 900+kb background image. Top that off with videos, streaming audio, html comments, other images...your looking at a 2-3 minute load time for your page. That's way too much. It took close to a minute for me over broadband!

I don't know if your into statistics, but the more bandwidth your page consumes, the higher the probability that the user will not wait around. Other bands are just a click away.

buddylee17 216 Practically a Master Poster
buddylee17 216 Practically a Master Poster

Yes, the same for more fields. Basically, if you add a text field into the form, you'll need to update the javascript variable, postr on line 52 above so that it will send the value to the php file.

Also, for better design, the javascript should be placed in an external .js file (for better organization and so it can be cached) and called from the head of the document.

buddylee17 216 Practically a Master Poster

If you have access to php.ini, you can set this by changing the date.timezone value.

[Date]
; Defines the default timezone used by the date functions
date.timezone = America/Los_Angeles

Also, if you just want to change the timezone for local script, use the date_default_timezone_set function.

<?php
date_default_timezone_set('America/Los_Angeles');
$time=date('h:i A');
echo $time;
?>
buddylee17 216 Practically a Master Poster

Actually, I modified your query to test the code in my db prior to posting and it outputted "No rows retrieved'". Also, when I run the code like so:

$sql = 'SELECT * FROM `absent faculty table` WHERE absentid = "blah"'; 
$result=mysql_query($sql,$conn);
$num_rows = mysql_num_rows($result);
echo $num_rows;

it returns 0 every time.

Have you got an error in your query?

OmniX commented: Thanks helped me find my problem! +2
buddylee17 216 Practically a Master Poster

Rewrite rules don't actually hide the query string. Rewrite rules pretty much convert seo friendly urls into the actual query string.
Example .htaccess:

RewriteEngine on 
RewriteRule ([^/\.]+)/?.html$ viewPage.php?ID=$1 [L]

The above rewrite rule will allow you to do something like this:
url reads: yoursite.com/DaniWeb.html
apache interprets as: yoursite.com/viewPage.php?ID=DaniWeb
Therefore

<?php
$id=$_GET['ID'];
echo $id;
?>

will output DaniWeb.

Shanti C commented: Thanks Man... +3
buddylee17 216 Practically a Master Poster

You have to get the number of rows.

$a = "SELECT * FROM a WHERE b = c";
$b = mysql_query($a);
$num_rows = mysql_num_rows($b);
if($num_rows == 0) {
 echo "No rows retrieved";
} else {
 echo "Rows retrieved";
}

Is that what you were asking?

buddylee17 216 Practically a Master Poster

Here is a simple AJAX form submission using POST. It basically sends the first and last name to the server, and the server outputs the form information and the date on the server. Very simple, but easy to build on.
post.php:

<?php
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$today = date("m/d/Y");
//send output back to page.
echo "Hello $FirstName $LastName. Todays date is $today.";
?>

html file(name it whatever you want):

<!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=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" language="javascript">
   var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('myspan').innerHTML = result;            
         } else {
            alert(http_request.status);
         }
      }
   }
   
   function get(obj) {
      var poststr = "FirstName=" + encodeURI( document.getElementById("FirstName").value ) +
                    "&LastName=" + encodeURI( document.getElementById("LastName").value );
      makePOSTRequest('post.php', poststr);
   }
</script>
</head>
<body>
<form action="javascript:get(document.getElementById('myform'));" name="myform" id="myform">
<input type="text" id="FirstName" />
<input type="text" id="LastName" />
<input type="Submit" value="Submit" /> …
nav33n commented: Good example.. +10
buddylee17 216 Practically a Master Poster

Have you added a loop to display the output?

<cfquery name="players" datasource="connsilvereagles">
SELECT *
FROM player
ORDER BY playernumber DESC</cfquery>

<cfoutput>
<table>
<cfloop query="players">
<tr><td>#playernumber#</td></tr>
</cfloop>
</table>
</cfoutput>
peter_budo commented: Good job +15
buddylee17 216 Practically a Master Poster

I'd recommend finding a good php library that allows for SMTP authentication. If the email client has decent security, php's plain old mail function with html headers is a sure fire way to get your email tossed in the junk folder. I use class.phpmailer.php. It also creates a plain text message for clients that don't allow html.

buddylee17 216 Practically a Master Poster

The file is included inline and parsed just like the contents of the file would be if they were placed there instead. A standard include for the content could be something like:
content.php:

<div class="content">
<?php echo $content;?>
</div>

Then the page could be something like:

<?php
//query db and populate $content variable here.
?>
<html>
<head><title>Page</title></head>
<body>
<?php include "content.php";?>
</body>
</html>

The above would display the same output as:

<?php
//query db and populate $content variable here.
?>
<html>
<head><title>Page</title></head>
<body>
<div class="content">
<?php echo $content;?>
</div>
</body>
</html>

You should also consider using includes for things that are common throughout the site, like the navigation menu. This way, if you have 50 pages on the site and you want to add a link to the navigation menu, you only have to change one file, instead of 50.

buddylee17 216 Practically a Master Poster

</br> should be <br> for html and <br /> for xhtml. There is no such thing as </br>.

Also, why are you using vbscript? You do know vbscript only works in Internet Explorer right? Use JavaScript.

buddylee17 216 Practically a Master Poster

Modify the query to assign the count number to the kwcount column:

$sql="select id,count(keywords) AS kwcount from seeker where userid=".$id;

You can then retrieve kwcount in the same way that you retrieve the id column.

buddylee17 216 Practically a Master Poster

Welcome to DaniWeb! Here are some basic guidelines to get any problem solved here:
When posting code of any sort, it's important to use code tags. Here's an example:

[code=php] <?php echo "Hello world."; ?>

[/code]
And your code will look like this:

<?php
echo "Hello world.";
?>

This way, each line is numbered, the syntax is highlighted, and the start and stop points of the code are clearly defined. The Toggle Plain Text option also creates a way to easily copy/paste the code into an editor and test it.
You're issue is on line 1, but what is in line 1? thank you? What if your error was on line 57?
Also, the thread title should clearly define your problem, not just state help.

buddylee17 216 Practically a Master Poster

Please review the Member Rules, specifically the "Keep it Organized" section regarding proper use of code tags. Without the tags, there is no toggle plain text option, and most of us will not bother troubleshooting.

buddylee17 216 Practically a Master Poster

Is rotate in the querystring (the part of the url after the ?)?

Your querystring should be something like:
http://www.yoursite.com/page.php?x=1&y=2&rotate=left&scale=50

You are then pulling them out of the string and assigning them to a variable with $_GET. If the value is not in the querystring, you'll get an undefined index.

buddylee17 216 Practically a Master Poster

Sounds like you need to put single quotes around the x:

$x = escapeshellarg( $_GET['x'] );
buddylee17 216 Practically a Master Poster

Just a side note, you may be better off loading all of the dropdowns directly into javascript from php when the page loads. If the page contains multiple AJAX requests that go one after the other, I'd either recommend to do it this way or to follow Mibbits guide to optimizing http headers for AJAX.

Why?
Similar to any other http request, an AJAX request contains all the headers (Content-Type, User-Agent, Accept, Keep-Alive...) plus the content sent to and from the server. Most of the time, the AJAX request may only contain 10-50 bytes, but the headers sent with the request may add an extra 300-500 bytes. So the header overhead actually consumes more bandwidth than the data sent to and from the server.

Only use AJAX when it will be faster than a page submit to the server. If you have multiple AJAX requests in a row, it will be much slower than if you'd have just submitted them to the server with a form or loaded them all into javascript when the page is loaded.

I'm not saying don't use AJAX. Use AJAX intelligently.

buddylee17 216 Practically a Master Poster

Either disable html messages or look into using BBCode

buddylee17 216 Practically a Master Poster

Use captcha.

buddylee17 216 Practically a Master Poster

This is a common problem, as text is so small. There is very little area to define where the mousover stops and the mouseout starts. So the display constantly toggles as the mouse wont sit perfectly still.
In Flash, this is often cured by creating an invisible box to place over the text and triggering the event with a mousover(actually its called onRollOver in ActionScript) the box.
Similarly in CSS, you could place an invisible div over the text and give it the mouse events, giving more area to define where the mouseover and mouseout are executed.

buddylee17 216 Practically a Master Poster

You've got to make it a link:

$link = "<a href='".BASE_URL . 'activate.php?x=' . urlencode($e) . "&y=$a'>".BASE_URL."</a>";
buddylee17 216 Practically a Master Poster

What does echo $link; output?

buddylee17 216 Practically a Master Poster

So are you wanting the link content to fill the white box?

buddylee17 216 Practically a Master Poster

Use the exec function.
http://us2.php.net/function.exec

buddylee17 216 Practically a Master Poster

No clue. This is one of the many tasks of a technical worker. Communicating with the "not so technical" client. Contact your client and get more info on what a "Style Guide" should include.

buddylee17 216 Practically a Master Poster

Post the code

buddylee17 216 Practically a Master Poster

You could include it as a client or server side include. Are you wanting to call it before, during, or after the page is loaded?