=OTS=G-Man 26 Light Poster

There is 2 ways you can do this, depending on what you have available to you at the time of saving.

If you have the data that was already in the field available in a variable, then best to just use PHP to append the addition to the string.

or you can use the SQL function CONCAT() to do it for you

UPDATE myTable SET message=CONCAT(message, '$newMessage') WHERE id=$myMessageID

as for adding a timestamp or newline you can use sprintf()

$newMessage = sprintf("\n%s - %s", date("d/m/Y"), $form_newMessage);

might check syntax, writing from memory and before bed ;)

anyway, hope this helps you.

=OTS=G-Man 26 Light Poster

mysql_fetch_array() returns an array with indexes, not field names.

You can pass the optional paramater MYSQL_ASSOC like so, mysql_fetch_array($result, MYSQL_ASSOC)

or you may use mysql_fetch_assoc() and that will return the array with field names.

Hope it helps.

=OTS=G-Man 26 Light Poster

ok, figured it out.

the issue is the base64_encode. In PHP the md5 is returned as a lowercase string and C# returns the binary of the hash, using capital letters, so to get it to work, you have to tell php to capitalize the hash string before encoding it.

in short we where encoding
098F6BCD4621D373CADE4E832627B4F6 - .NET (after converting binary to chars)
098f6bcd4621d373cade4e832627b4f6 - PHP

so this PHP

<?php

$pwd="test";
$hash = base64_encode(strtoupper(md5($pwd)));

echo $hash

?>

matches the output of

Encoding.UTF8.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile("test", "MD5"))
a_salted_peanut commented: Simple, straight to the point, clear and consice. Has saved alot of hairloss on my part. +0
=OTS=G-Man 26 Light Poster

to get the PHP style MD5 output you have to use FormsAuthentication.HashPasswordForStoringInConfigFile from the System.Web.Security name space.

So you will need to add the system.web.dll to your references.

Also you have to watch the encoding, to match PHP's i had to use Encoding.UTF8.GetBytes().

Thanks for asking the question, because i never knew there was a difference in the outputs.

I wrote mine in C# but should be able to translate to VB.NET pretty easy, but here is my test code

using System;
using System.Text;
using System.Web.Security;

namespace md5
{
    class Program
    {
        static void Main(string[] args)
        {
            byte[] hash = Encoding.UTF8.GetBytes(FormsAuthentication.HashPasswordForStoringInConfigFile("test", "MD5"));
            Console.WriteLine(Convert.ToBase64String(hash));
            Console.ReadKey();
        }
    }
}
=OTS=G-Man 26 Light Poster

could just try to request the username your looking into with the profile feed

http://gdata.youtube.com/feeds/api/users/username

should get a 404 with User not found in the body, if the user is not created.or a normal feed if they exist.

More info here http://code.google.com/apis/youtube/2.0/developers_guide_php.html#Profiles

=OTS=G-Man 26 Light Poster

Well i see a few things that seem to be missing,

1) What ddanbe said, but on all of them, to see if its between should be checking for > and <

2) I dont see where you set numGrade to anything other then 0.
at the top of your button1_Click method i would expect to see like
numGrade = textbox.Text;

*just an observation, but don't need to use numGrade.ToString("F") to set the text of a textbox. just use textbox1.text = "F";

I don't want to give too much detail, cause this just has that, its home work feel ;)

johnt68 commented: Great prompting thank you +1
=OTS=G-Man 26 Light Poster

Actually I think the FileName and Arguments mixed up because the final command yours is running would look like
C:\>lease_query.pl perl lease_query.pl 192.168.0.100
and lease_query.pl is not an executable.

so i think it should be.

p.StartInfo.FileName = "perl";
p.StartInfo.Arguments = "lease_query.pl " + ipAddress;
nick.crane commented: I didn't see that. Well spotted. +1
=OTS=G-Man 26 Light Poster

Well you wont be able to stop the upload itself, because it is sent with the POST. But from the looks of your script, Just need to rearrange it so that you can stop from saving script files.

Think you should do the ban check first before adding the entry to the database, then all you will have to do on a fail it delete the temp uploaded items.

=OTS=G-Man 26 Light Poster

If you are running XP Pro. you can use the net command to activate login restrictions.

From an administrator account:

1) Click the Start menu and choose Run.
2) type in cmd in the dialog that opens.
3) In the command window, type net user SiblingsAccount /time:M-F,00:00-20:00

This will limit the user SiblinsAcount to only be allowed to login during the hours listed (Midnight-8PM). You can have different times based on the day by using something like

net user SiblingsAccount /time:M-F,00:00-20:00;SA-SU,all
this will all login all day Saturday and Sunday and back to the Midnight-8PM on weekdays.

To remove all restrictions use the command net user SinlingsAccount /time:all

Hope this helps.

=OTS=G-Man 26 Light Poster

If you doing a full install of Windows 7, none of the preinstalled applications will stay. The only way to use them again is if they came on a separate CD that you can install after installing 7, but manufactures rarely do that anymore now that most use a restore partition that just has an image of the drive as it shipped.

Only option to keep them would be to do a windows 7 Upgrade. Thus keeping all your files and program installed, but just upgrading Vista to 7.

=OTS=G-Man 26 Light Poster

Well its good if you have user controls, VS will auto add your control to the toolbox and will also build the control when you compile your app that uses it.

also its nice when working on multiple DLLs or a project that uses DLLs that you have/written source for to have them all in one project so they all get built together and for debugging purposes.