|-|x 126 Junior Poster in Training

@azareth: you don't need to specify the column names in an sql insert statement so long as you include values for all columns in the table in the order specified in the table schema.

|-|x 126 Junior Poster in Training

The problem is that your binary data (ie: image content) contains characters that are invalid in a mysql string.

Take a look at the LoadFile function if you have the image file available on the server, or you can escape the string in PHP prior to passing it to the mysql query.

Alternately, you could manually encode the binary data to base64, but you will need to ensure you also decode it when you read the data from the database.

|-|x 126 Junior Poster in Training

Hi all,

I'm looking for a good tool for analysing Windows Server Event Logs. Basicaly, I want to be able to filter by types of entries or content, and search. If it has some smarts built in for things like highlighting suspicious behaviour that would be great too. I need to be able to monitor/review IIS activity and Active Directory access.

Any recommendations?

cheers
/H

|-|x 126 Junior Poster in Training

I have a site that does exactly this.

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

./index.php

<?php
/** Tells WordPress to load the WordPress theme and output it. */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require('./wordpress/wp-blog-header.php');
?>
|-|x 126 Junior Poster in Training

OK, firstly, the number of fields does not match up to your insert query. Looks like you are missing the email field out of the insert.

Sencondly, I assume user_id is an autoincrement key field. In order to make it work properly you need to insert NULL not and empty string.

"INSERT INTO user VALUES(NULL, '$firstname', '$lastname', '$username', '$password', '$email', '$dob', '$gender')"

You will need to make sure you grab the email from the post data, as it looks like you missed that (or I just can't see it)

It's also advisable to check the data for single quotes ' and other characters that may cause errors in the mysql and escape or remove them.

$firstname = str_replace("'","\'",$firstname);

etc.

also, your DOB variable is $dob_db, so check that in your insert statement.

|-|x 126 Junior Poster in Training

no problem, glad I could help. :)

|-|x 126 Junior Poster in Training

actually... I may have just spotted it.

at line #114 above, on completion of processing a successful post you are redirecting the browser to the same page. This will clear the previously posted data and rerun the same script

header('Location: register.php');

It is also redundant as they will already be on the register page, and redirecting will override any messages you wish to display to the user. I suggest removing this line and try it again, you may find it has been working the whole time. ;)

...
update... just tested this theory on my server, and I get the "dead" path executed with no post data as you have described. I will almost guarantee that this redirect is your root cause

diafol commented: good catch +14
|-|x 126 Junior Poster in Training

hmm... seems very strange. I have run and tested your code above and I get all the POST data correctly, and your isset($_POST['submit']) check is successful.

I can only conclude that the problem is not in this code file. Can you post what is in the included connect.php file?

Is there any parent code (such as templates or CMS stuff) that might be affecting / intercepting the code?

|-|x 126 Junior Poster in Training

Check the session_start() call like I said before as it may be resetting the POST variable.

Also, not sure if this may be causeing a problem or not, but all your html input tags are poorly formed having no close. ie:

<input type="submit" name="submit" value="Register">

should be

<input type="submit" name="submit" value="Register" />
                          // see tag close here ..  ^

In my experience a named submit button should be available in PHP via the POST variable, and should have the value assigned to the button (ie: its display text) in this case, it should be true that $_POST['submit'] == "Register"

It is possible that naming the button 'submit' may also be an issue, although I doubt it, but this is an easy thing to test.

Another thought... clear your browser cache and make sure you use ctrl+F5 to force a full refresh of the page (clear cookies as well to ensure you get a fresh session) as empty POST data can sometimes be caused by browser or proxy caching the POST request.

|-|x 126 Junior Poster in Training

yes, it would seem so.

I wonder if your call to session_start() or something in that include file is resetting/clearing the POST variable?

maybe try something like this and see if you get your post data

if (!isset($_SESSION)) {
  session_start();
}
|-|x 126 Junior Poster in Training

<form action="" method="post">

Don't you still need to specify the current page address for the postback to work?
disclaimer: it's entirely possible I'm wrong...

Also, for debugging purposes you could add print_r($_POST) to the top of the page to see what the actual post data contains on submit.

|-|x 126 Junior Poster in Training

so, you want to move the background image to the right?

background-position-x: 5px;

and try background-position: 50px 200px; on your body background to move the image lower and to the right.

JorgeM commented: good response +5
|-|x 126 Junior Poster in Training

Ok... so I will use your image as an example of what we could do.

First lets add an index parameter to your function.

<?php function ARG_FF($index) {?>
<tr>
    <!--AIR RESTRICTION GAUGE-->
    <td><select name="gauge[<?php echo $index; ?>]">
        <option value="8">8</option>
        <option value="11">11</option>
        <option value="15">15</option>
        <option value="22">22</option>
        <option value="25">25</option>
    </select></td>
    <!--FUEL FILTER-->
    <td><select name="filter[<?php echo $index; ?>]">
        <option value="20">20%</option>
        <option value="40">40%</option>
        <option value="60">60%</option>
        <option value="80">80%</option>
    </select></td>
</tr>
<?php }?>

Then we create a loop in the form to call the function and print the select controls.

<table>
    <tr><th>Air Restriction Guage</th><th>Fuel Filter</th></tr>
    <?php for ($i = 1; $i <= 8; $i++) { 
        ARG_FF($i);
    } ?>
    <!-- I'm not sure what your table footers are, but you can add a row here -->
</table>

This produces output like the following:

<table>
    <tr><th>Air Restriction Guage</th><th>Fuel Filter</th></tr>
        <tr>
    <!--AIR RESTRICTION GAUGE-->
    <td><select name="gauge[1]">
        <option value="8">8</option>
        <option value="11">11</option>
        <option value="15">15</option>
        <option value="22">22</option>
        <option value="25">25</option>
    </select></td>
    <!--FUEL FILTER-->
    <td><select name="filter[1]">
        <option value="20">20%</option>
        <option value="40">40%</option>
        <option value="60">60%</option>
        <option value="80">80%</option>
    </select></td>
</tr>
    <tr>
    <!--AIR RESTRICTION GAUGE-->
    <td><select name="gauge[2]">
        <option value="8">8</option>
        <option value="11">11</option>
        <option value="15">15</option>
        <option value="22">22</option>
        <option value="25">25</option>
    </select></td>
    <!--FUEL FILTER-->
    <td><select name="filter[2]">
        <option value="20">20%</option>
        <option value="40">40%</option>
        <option value="60">60%</option>
        <option value="80">80%</option>
    </select></td>
</tr>
    <tr>
    <!--AIR RESTRICTION GAUGE-->
    <td><select name="gauge[3]">
<!-- etc.... (cropped for brevity) -->

Then we just need to put your page code into a loop to process the mysql for each iteration.

for ($i = 1; $i <= 8; $i++) { 
    $gauge=$_POST['gauge'][$i];
    $filter=$_POST['filter'][$i];
    $gaugeFilter="INSERT INTO abc (ARG,Fuel_Filter) VALUES ('$gauge','$filter')";

    if (!mysql_query($gaugeFilter,$con))
    {
        die('Error: ' . …
|-|x 126 Junior Poster in Training

It is not difficult, though a little finicky as you have to use the DirectoryEntry and/or DirectorySearcher objects.

here is the official guide: http://msdn.microsoft.com/en-us/library/ms180906(v=vs.80).aspx

And some other examples to get you started;

http://www.daniweb.com/software-development/csharp/threads/339418/active-directory-search-filter-syntax-help

http://stackoverflow.com/questions/7915145/get-all-users-from-a-group-in-active-directory

|-|x 126 Junior Poster in Training

Are you typing into this textbox or setting it programatically? If typing, then the event would be triggered for every key press, and thus you will experience multiple successive postbacks.

If any other function/event occuring is changing the text in code on PostBack, it could be triggering an additional postback from that event as well.

Just food for thought.

|-|x 126 Junior Poster in Training

It could be on the css file itself, at filesystem level.

Imagine you are saving the css source code in a text editor. At the file save dialog, in some editors you can specify the character set of the file, ie: ascii, utf8 etc. If this has been set to something that conflicts with the web pages delivery as specified in the HTML source, this may cause the browser to interpret the css file contents incorrectly.

When I saved and opened the file I can see that it has been saved in a UTF8 format. The browsers default interpretation may not be detecting this.

Possible solution: You can specify the charset in the link tag. (Note the link tag should also have a close backslash, not sure if this may be affecting the functionality as IE can sometimes be more lenient on invalid HTML.) See this page for more details, but I would try something like this.

<link rel="stylesheet" type="text/css" charset="utf-8" href="http://www.classixrock.com/classix.css" />
JorgeM commented: appreciate it! +0
|-|x 126 Junior Poster in Training

It looks to me like it might be a charset configuration problem. If I view the CSS file in Chromes dev tools it shows up as Chinese text. The charset might be specified in the file itself or possibly in the web server where it is storing/delivering the file.

Check out the screenshot to see what I'm talking about.
chrome

JorgeM commented: great job on the troubleshooting! +4
|-|x 126 Junior Poster in Training

I think you have understood the problem correctly. The database will not work correctly if the UserID is Foreign Key to 3 separate user tables.

Rather than trying to condition the FK based on the Type field, it might be better in this scenario to split the UserID into 3 separate fields, each FK linked to the appropriate user table.

Example

CREATE TABLE login (
  LoginID varchar(20) not null,
  AdminID int null,
  PatientID int null,
  SLP_ID int null,
  Password varchar(20) not null,
  PRIMARY KEY (LoginID),
  KEY AdminID (AdminID),
  KEY PatientID (PatientID),
  KEY SLP_ID (SLP_ID)
);
ALTER TABLE login
  ADD CONSTRAINT login_fk1 FOREIGN KEY (AdminID) REFERENCES Admin (AdminID),
  ADD CONSTRAINT login_fk2 FOREIGN KEY (PatientID) REFERENCES Patient (PatientID),
  ADD CONSTRAINT login_fk3 FOREIGN KEY (SLP_ID) REFERENCES SLP (SLP_ID);

If you can post the SQL create scripts for your tables, and a sample data set we will be able to get a better idea of how to help you.

|-|x 126 Junior Poster in Training

Assuming the autoincrement ID's do match up in both tables you could use a subquery like so...

...
WHERE BuyPortfolio.[STOCK ID] NOT IN (SELECT [STOCK ID] FROM Portfolio)

This will return all records in the BuyPortfolio table which are not in the Portfolio table according to the ID's.

|-|x 126 Junior Poster in Training

Where you are setting Tableid, I believe you are actually redeclaring a local variable with the same name, so your global is never getting set. Try removing the var from line 6 and see if that solves your problem.

Here is some general information on javascript variables that may also be helpful:
http://www.w3schools.com/js/js_variables.asp

|-|x 126 Junior Poster in Training

What exactly do you mean by parse? Are you searching for specific values in the data?

I would almost guarantee that doing these operations in an SQL script will be faster than processing manually in any programming language.

|-|x 126 Junior Poster in Training

Try something like the below ... (this code assumes you have done the relevant sql object declarations)

Dim strFrom AS String = ""
strQuery = "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'Database1'"
con.Open()
theQuery.Connection = con
theQuery.CommandText = strQuery
theReader = theQuery.ExecuteReader
While theReader.Read
    If strFrom = "" Then strFrom = "FROM " & theReader("TABLE_NAME")
    ELSE strFrom &= ", " & theReader("TABLE_NAME")
    End If
End While
theReader.Close()
con.Close()
|-|x 126 Junior Poster in Training

line 10 is not quite right.

strFrom &= theTable

you would need to access the row and field inside the table object.
(sorry about this example, but can't recall exact vb syntax off hand, in c# it would be something like this...)

strFrom &= theTable.rows[0].cells[0]

This should grab the first value of the first row returned in the table, you can of course reference any valid row/column index.

Note: you would need to loop through the table rows to obtain all results if more than one is returned/required.

alternative method:
If you structure your initial query so that it will only return a single result item you could use strFrom &= theQuery.ExecuteScalar without the need for an adaptor or table object. But this will work with a query that returns only a signle record with a single field

|-|x 126 Junior Poster in Training

try maybe sorting on ID and date both descending

SELECT * FROM $logbook WHERE Date<='$Date' AND ID!='$ID' ORDER BY Date DESC, ID DESC LIMIT 1

you could also add an extra clause to exclude the previously selected ID AND ID!='$Next["ID"]'

(of course you need to grab the value from the MySQL result properly, but you get the idea)

|-|x 126 Junior Poster in Training

There is a function called LEFT which can be used to grab the first letter of a field for comparison

example:

SELECT * FROM tblBrands WHERE LEFT(Brand,1) BETWEEN 'A' AND 'E'

etc...

|-|x 126 Junior Poster in Training

Thines01: that still won't increment when the initial condition is false as it will not enter the loop.

shean1488: actually you can do exactly as you wished, simply add count++ to your condition statement...

while(count++ > 0 && some expression && another expression)

this will increment count each time the condition is evaluated and (so long as count is not negative) will always evaluate to true and thus not affect the outcome of the condition statement.

|-|x 126 Junior Poster in Training

I would also add that if it is an old TV show, it may have been released into the public domain and/or the original copyright holders no longer claim rights to the property. In such a case it would not be illegal for you to download and watch the show from any source.

This is common enough but will depend on the owning company, as some are happy to release their stuff for public consumption when they no longer feel it is potentially profitable, others seem to hang onto it forever in order to maybe sell the rights to produce sequels/remakes/spinoffs etc.

|-|x 126 Junior Poster in Training

http://www.albahari.com/threading/

This was the best resource I found when starting to work with threads. If I understand your problem correctly, you either want to Sleep each thread to wait for the other to do its work, or possible create a resource lock until your data acquisition thread completes its work, and then the communication thread will gain access to the resource and, well, presumably it will communicate with something.

Anyways, hope this helps.
/H

kvprajapati commented: :) excellent link +14
|-|x 126 Junior Poster in Training
 var days(7);
 days(0) = "Sunday";
 ...
 function SetDay (day) {
   document.GetElementById("Daybox").value = "You Selected " + days(day) + " for your delivery";
 }

I think the rest is the same.

|-|x 126 Junior Poster in Training

good catch..

also looks like there might be too many closing quotes on '%$each%''"

|-|x 126 Junior Poster in Training

It is possible that the page variable hAns is losing its value on postBack. You could try storing this in a Session or Viewstate variable instead.

However, as the other guys have suggested, you should place a breakpoint on the line of code for the comparison and check what value each has at that time. Making the assumption that a variable/object has a value because you have set a value at some previous time is not necessarily valid.

Lusiphur commented: Agree with you and Consider, I'll have to look into that this week to see if it's the case... +9
|-|x 126 Junior Poster in Training

WHERE DATE BETWEEN

Correct me if I'm wrong but isn't DATE a reserved word?

If that's the name of your field in the `medicalrecords` table, you may need to use backticks around it, ie:

WHERE `DATE` BETWEEN
diafol commented: good spot +15
karthik_ppts commented: Yes +7
|-|x 126 Junior Poster in Training

Is it possible t set a control's property in the markup using server tags? Specifically in this case I need to set it from a Session value, ideally something like this:

<asp:Label ID="Label1" runat="server" Text='<%= Session["value"] %>' />

Of course the above simply prints as literal text, rather than evaluating the expression.

I know I can do it in the code behind, but in the circumstances it would be a lot cleaner if I could somehow do it in the markup or "bind" the property to the Session value.

Open to ideas, any suggestions appreciated.

Cheers
/H

|-|x 126 Junior Poster in Training

Apologies for the delay, was off last week for the holidays.

The page code looks like this

corp-info/order-form

<?php include './public/forms/order.php'; ?>
forms/order.php

<?php if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// check the POST data
//   do some stuff with the database
}
...
<form action="<?php echo URL_PUBLIC; ?>corp-info/order-form.html" method="post" enctype="multipart/form-data" name="order">
...

For some reason it seems like the POST data is coming back to the page empty. If I do a print_r($_POST); at the top, I just get an empty Array() printed to the page.

|-|x 126 Junior Poster in Training

if you are using Windows authentication, rather than Forms (in your web.config)

<authentication mode="Windows">

Then the User.Identity.Name == "DOMAIN\\UserName" which you can split and use to validate via the DirectorySearcher class.

Hope this helps
/H

|-|x 126 Junior Poster in Training
For Each row As GridViewRow In GridView1.Rows
Dim cb As CheckBox = CType(GridView1.FindControl("ChkSelect"), CheckBox)

I believe you should be looking for the control inside the row, not the whole grid.
ie:

For Each row As GridViewRow In GridView1.Rows
Dim cb As CheckBox = CType(row.FindControl("ChkSelect"), CheckBox)
|-|x 126 Junior Poster in Training

Are you getting any specific error messages?

|-|x 126 Junior Poster in Training

Hi all

Is anyone here familiar with coding in WolfCMS?

I have been asked to add a form page to an existing website based on WolfCMS, but have little experience on the platform. For some reason my form doesn't seem to be receiving the POST data, or executing the processing properly. Any guidance as to the requirements or configuration for the cms would be appreciated.

cheers
/H

|-|x 126 Junior Poster in Training

I would do the same as you did for the figures.
note, you can specify multiple css classes where needed.
eg:

<div class="article"> ... </div>
<div class="section testi-left">

also class="header" is different from id="header" so you could do that, and your css would look like

#header {...}
#header .header {...}
#header .nav {...}
|-|x 126 Junior Poster in Training

No offense chrislim2888, but you aren't 100% correct.

Below is the header information from a post on a Google group. While the specific details are irrelevant, it clearly shows email address, server name, ip address and a variety of other data that could be used to track a users virtual identity. The amount of information a person could glean from this depends on their intent, interest, and technical skill. Given that Google groups operates based on email, and email always contains IP data in the header, there is not much you can do besides looking into an anonymous server host of some sort.

However, the type of information you are talking about theguitarist, requires virtually no skill and only minimal knowledge to obtain and represents little threat to you. Geo-spacial data for example can be obtained from a number of free services once they know the source IP address.

Received: by 10.43.53.72 with SMTP id vp8mr2814576icb.0.1322663078573;
        Wed, 30 Nov 2011 06:24:38 -0800 (PST)
X-BeenThere: backbox-linux@googlegroups.com
Received: by 10.231.11.72 with SMTP id s8ls4042618ibs.3.gmail; Wed, 30 Nov
 2011 06:24:37 -0800 (PST)
Received: by 10.43.48.202 with SMTP id ux10mr2730390icb.6.1322663077799;
        Wed, 30 Nov 2011 06:24:37 -0800 (PST)
Received: by 10.43.48.202 with SMTP id ux10mr2730388icb.6.1322663077780;
        Wed, 30 Nov 2011 06:24:37 -0800 (PST)
Return-Path: <raffaele.fo...@gmail.com>
Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172])
        by gmr-mx.google.com with ESMTPS id ib2si372785icc.4.2011.11.30.06.24.37
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 30 Nov 2011 06:24:37 -0800 (PST)
Received-SPF: pass (google.com: domain of raffaele.fo...@gmail.com designates 209.85.210.172 as permitted sender) client-ip=209.85.210.172;
Authentication-Results: gmr-mx.google.com; spf=pass …
|-|x 126 Junior Poster in Training

you need to do the same with the other tags section article header footer nav and also don't forget the closing tags </figure> should all be </div> although Arkinder is correct in that it is recommended to specify the exact doctype you are using, IE should actually choose the latest version it knows about that is compatible with your document when you use <!DOCTYPE html>

Arkinder commented: I find that it makes a little more sense semantically, and IE7 has never been known for behaving the way that it should. Regardless you're correct in the behavior of the HTML5 DOCTYPE. +7
|-|x 126 Junior Poster in Training

I was just about to post asking how to do this when I stumbled across the solution. All my research on the web suggests that the only way is to use stored procedures with an output parameter. Unfortunately, my queries are necessarily dynamically generated, and output parameters do not work with text commands on MySQL. (I wont go into the cause of that issue here, but it is well documented online.)

I did manage to find that the class MySql.Data.MySqlClient.MySqlCommand actually contains the last_insert_id() as a property. So I was able to write code in my datasource Inserted event like this...

protected void datasource_Inserted(object sender, SqlDataSourceStatusEventArgs e)
    {
        int newID = ((MySqlCommand)e.Command).LastInsertedId;
    }

Anyway, since it took me a while to find, I thought I'd post this here to try and help someone else who may be having the same problem.

Cheers
/H

|-|x 126 Junior Poster in Training
|-|x 126 Junior Poster in Training

Its the specific tag names, such as article section figure figcaption etc. that are HTML5. You could change them to divs with a css class like

<div class="figure">

and change your css to match

#testimoni .figure{float:left}

hope this gives you the idea

|-|x 126 Junior Poster in Training

I don't believe IE7 will be capable of handling the HTML5 tags. I suggest either downloading IE9 (or the latest version of FireFox or Chrome) or replacing the HTML5 tags with HTML4 compatible tags, such as DIVs in order for your style sheets to function as expected in older browsers.

Depending on your target audience, you can't guarantee that the end users will be using the latest browser versions so you may want to look at backwards compatibility. I am not an HTML5 expert, but I'm sure there are plenty of fallback examples available.

|-|x 126 Junior Poster in Training

What version of IE are you using?

What does it look like in other browsers like FireFox or Chrome?

Are you specifying a DocType definition tag?

Since you are using HTML5 tags like <figure> it will only display properly in recent browser versions that support HTML5.

|-|x 126 Junior Poster in Training

You are never really anonymous on the web. Hence all the browser proxy servers and vpn services available for people who wish to obfuscate their identity.

All of that information can be obtained from simple analysis of your IP address, which is (as a matter of necessity) passed to the server with every web request. I'd say that person is just messing with you, and it is not really anything to worry about. This type of thing happens all the time, particularly on "hacker" forums and the like.

|-|x 126 Junior Poster in Training

I'd suggest maybe setup a virtual pc or something, but afik you can't go higher than your active screen resolution anyway.

|-|x 126 Junior Poster in Training

Sorry, Tariq

I think I misread your previous post. You will need to specify the filter on each menu link individually, as they all have different images.

Something like:

<div id="button">
    <ul>
      <li><a href="index.html" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/home.png', sizingMethod='scale'); padding-left:20px;">Home</a></li>

...

You will probably need to play a little with the position to get it right. Of course, the style can all be moved into a css file if you prefer.

|-|x 126 Junior Poster in Training

you can place the filter into your css file

#button {
  filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png', sizingMethod='scale');
}