Josh Connerty 20 Unverified User

You could always download Hijack This run a scan and then post the log, and also malware bytes will remove most viruses but as said before it will sometimes shred your regisstry depending on how far the virus is engraved into it.

Josh Connerty 20 Unverified User

The form itself displays each of the headers.... title, subtitle, content, author and date..... but it doesnt echo the data that is held in the mysql database.

On changing the cell information and clicking submit, a success message is given, but the row in the database is not updated.

Okay in that case, please add the following at the end of your update query.

$query = mysql_query("QUERY") or die( "UPDATE ERROR:" . mysql_error() );
// QUERY being the update query you have been using.
Josh Connerty 20 Unverified User

Another point, with MySql the advice given is you use as many tables as possible as to releive the stress on any one particular table.

Josh Connerty 20 Unverified User

Before you start, be aware that you may be 'bloating' your app without need. The basis for a good app/site is solid data structure. I don't think you've got it yet. If your data structures are all to hell, a javascript framework won't help.

I'd suggest redesigning a streamlined version of your tables - make them relational (as I suggested earlier). If you need to add ajax later on, fine, your database will be set up to deal with it. Ajax ain't a magic bullet.

Good luck again!

PS. @ Josh - sorry mate, didn't mean to diss your suggestion.

No youre right in what you are saying, however I think what he is wanting is something that will perform these things without page refresh.

Okay, please export your database using phpmyadmin and then post it here so as I know exactly what you database structure is liek and as ardav said try and make it more efficient.

Josh Connerty 20 Unverified User

Are you still on SP1 (XP Service Pack 1)?

Josh Connerty 20 Unverified User
Josh Connerty 20 Unverified User

Okay so what is it that you have changed exactly?

Josh Connerty 20 Unverified User

Not if it is a MBR-resident virus (very rare and very hard to get rid of without compete data loss).

Deleting the partitions is actually wiping the drive, and getting rid of potential MBR-resident viruses.. It is the partitions that are formated. Not the drive.. not directly.

I stand corrected! Very valid point.

Josh Connerty 20 Unverified User

In this case this is most likely something to do with a faulty motherboard...

I know this seems like a daft suggestion (I am just guessing know as it deffinetly seems to be a MOBO issue yet you have replaced it) but I had an old AMD system with a sticky power button. Mine would do the same unless you pulled the power button out :P.

Other than that, it seems you may have damaged the motherboard when fitting it. It is difficult to explain but just a surge of static can not neccesarily destroy but deffinetly damage the part.

This is a very parculiar issue. I mean usually that means either a PSU, the CPU or the motherboard its self. But you have mix and matched the three with seperate parts.

And yes you are right on the beeps. Without any RAM installed your motherboard should continously warn you that no RAM is present.
That is what lead me to beleive that the motherboard maybe faulty but it's probably not had chance to give you the warning.

One question, do you get anything on the screen during the 2 seconds that the system is booting?

Josh Connerty 20 Unverified User

No problem (that is if I have helped :P)

Josh Connerty 20 Unverified User

So we have a better idea can you post the whole document and leave the lines 123 - 125 in bold. This will give us a better idea of what the document is actually doing.

Josh Connerty 20 Unverified User

Try putting the sound card back in (the one you had the problem with) and clear your CMOS. This may help your system identify the two together.

Josh Connerty 20 Unverified User

You have no RAM in the system?

Josh Connerty 20 Unverified User

Just to add to this, you may find it was your DIMM port had dust in it this usually causes thisd issue so yes the dusting will have fixed that, but be carefull when dusting, you need to ground you and your computer and leave the power cable in but turned off at the socket.

Josh Connerty 20 Unverified User

As RJCO said the motherboard should not touch the case try removing the motherbard from the case and running it without the case. It sounds like maybe ou need some thermal solution or maybe it's a faulty CPU and you need to replace it. The thing is these things are difficult to diagnose without matching parts that work to test with.

Josh Connerty 20 Unverified User

It seems he has fixed it. Basicly what kireol said is probably the best way to pass varibles to another page.

The only shin dig I have is that the $_REQUEST method is not advised. Use the $_GET instead.

And again he is right when it comes to the mod rewrite. It doesn't turn your page address (http://example.ccom/index.php?id=something) into something pretty, it just provides another way of displaying it for example entering http://example.com/arts/100 will be re-written by apache so apache knows were to send it. The user will not see it, but what happens is apache changes it from what we had before to http://example.com/index.php?cat=Arts&id=100 for the server to parse it without the ugly URLS.

Josh Connerty 20 Unverified User

I'm not sure what you mean by a virus is detected when you format your hard drive.

When you format your hard drive you are wiping it clean and reinstalling the operating system. So you should start afresh with everything.

Josh Connerty 20 Unverified User

Yes clearing the CMOS sounds like the next step. Other than that you may have to find someone else with a 1GB stick of DDR and see if theirs works any better, by this I mean one that doesn't need to clock down.

But clearing the CMOS should make your BIOS administer new RAM. In a sense it has to POST from scratch all of your hardware to the BIOS so clearing it will make sure it scans for installed hardware again.

As said before it is major simple, there should be a 3/4 inch round battery either upright or flat, remove all of the power to the motherboard and remove this battery.

I leave it for 2 minutes just to be sure. Then fit your RAM, there shouldn't be a primary and secondary like the hard drives and ATA devices, then pop the battery back in.

After this boot your system and go into the BIOS and make sure your boot devices are in the correct order and correct the time and date. Then save the settings and reboot the system.

You should leave it to boot into the OS and login etc. and if all is fine then this has worked. ;)

(This is just incase you don't know how to clear your CMOS)

If this doesn't work however then I am lost. I haven't seen this happen too often but sometimes it requires you to format your hard drive but …

Josh Connerty 20 Unverified User

What do you mean as in if you haven't submitted the form you still get the row updated message?

Josh Connerty 20 Unverified User

This might sound daft but why not loop it until you have sent the mail to everyone?

This might cause a strain on the server CPU though.

Josh Connerty 20 Unverified User

I've got a similar build:
CPU: Intel Pentium 4 Duo (E5200)
RAM: 1GB DDR2 667MHz
HDD: 150 GB Samsung Spinpoint F1
MotherBoard: ASUS P5KPL-AM

And I've never really had a problem with the speed. I noticed that the E5200's are pretty good at overclocking and many have reached 3.8GHz. Also the P5KPL-AM has an overclocking profile, I tried it once but it wasn't stable on any of the settings. I wouldn't advise overclocking at all.

Josh Connerty 20 Unverified User

Glad you got it to work ;)

Josh Connerty 20 Unverified User

Oh thats because you need to declare the ones in the form as $_POST etc as you are only declaring them if the form has been submitted try this:

<?php

if ( isset( $_POST['send'] ) ) {
  // The author's details have been updated.

  
  $title = $_POST['Title'];
  $subtitle = $_POST['Subtitle'];
  $content = $_POST['Content'];
  $author = $_POST['Author'];
  $date = $_POST['Date'];
  $id = $_POST['id'];

  $sql = "UPDATE `indexinfo` SET
          `Title` = '$title',
          `Subtitle` = '$subtitle',
	    `Content` = '$content',
	    `Author` = '$author',
          `Date` = '$date'
          WHERE `id` = '$id'";
  if (mysql_query($sql)) {
    echo '<p>Author details updated.</p>';
  } else {
    echo '<p>Error updating author details: ' .
        mysql_error() . '</p>';
  }

?>


<form action="#" method="post">
<p>Edit the author:</p>
<label>Title: <input type="text" name="Title" value="<?php echo $title; ?>" /></label><br />
<label>Subtitle: <input type="text" name="Subtitle" value="<?php echo $subtitle; ?>" /></label><br />
<label>Content: <input type="text" name="Content" value="<?php echo $content; ?>" /></label><br />
<label>Author: <input type="text" name="Author" value="<?php echo $author; ?>" /></label><br />
<label>Date: <input type="text" name="Date" value="<?php echo $date; ?>" /></label><br />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="submit" value="Submit" name="send" /></p>
</form>
<?php
} else {
?>
<form action="#" method="post">
<p>Edit the author:</p>
<label>Title: <input type="text" name="Title" /></label><br />
<label>Subtitle: <input type="text" name="Subtitle" /></label><br />
<label>Content: <input type="text" name="Content" /></label><br />
<label>Author: <input type="text" name="Author" /></label><br />
<label>Date: <input type="text" name="Date" /></label><br />
<input type="hidden" name="id" />
<input type="submit" value="Submit" name="send" /></p>
</form>

The only problem is you need to specify the ID somehow. Without using PHP.

Josh Connerty 20 Unverified User

Have you tried removing your motherboard from the case and removing exccess parts one after another until you utilise the problem?

Josh Connerty 20 Unverified User

I'm not sure have you searched for a program? I know Windows uses the NTFS file format and I have forgotten the UNIX format you may need to google it.

Josh Connerty 20 Unverified User

Format your Hard Drive

Josh Connerty 20 Unverified User

It sounds more like a dodgey stick of RAM, I know AMD motherboards can have the funnies but it is unlikely. I have had an eMachines Intel Celeron M system and that had a 512MB RAM that I upgraded to 1.2GB RAM with mis matching frequencies and the newer higher frequency 1GB module clocked down as it should do.

So yes run memtest and confirm what they are clocking at so as to dismiss the dodgey underclocking.

Josh Connerty 20 Unverified User

Yes sorry I haven;t replied, the RAM with the higher frequency should clock down to the maximum supported frequency of your motherboard.

The reason DDR RAM is so expensive is due to the fact that they are no longer mass produced as all new computers are using DDR2 or DDR3 RAM.

You can convert your PC to a DDR2 Dual-Core system for around £160 from novatech (http://novatech.co.uk/) this is an english company if this will cause any isues. But I am sure there are more european companies similar to novatech.

Josh Connerty 20 Unverified User

Wich version of Vista and Ubuntu did you install x86 or x64? (32 bit or 64 bit)

If they were 32bit versions then you are likely to come across issues like this as the 32bit architecture can not utilise the full 4GB it is advised to use a 64 bit version of any operating system to accept more then the 3GB of RAM.

The other thing I was going to ask is do you know the Manafacturer and Model of your motherboard as this may be the motherboard not supporting the 4GB of RAM.

Josh Connerty 20 Unverified User

Oh and try to avoid using the @ suppresants until you have the script working and perfect else you may be missing some important errors.

Josh Connerty 20 Unverified User

Try this as yours is riddled with errors:

<?php

if ( isset( $_POST['send'] ) ) {
  // The author's details have been updated.

  
  $title = $_POST['Title'];
  $subtitle = $_POST['Subtitle'];
  $content = $_POST['Content'];
  $author = $_POST['Author'];
  $date = $_POST['Date'];
  $id = $_POST['id'];

  $sql = "UPDATE `indexinfo` SET
          `Title` = '$title',
          `Subtitle` = '$subtitle',
	    `Content` = '$content',
	    `Author` = '$author',
          `Date` = '$date'
          WHERE `id` = '$id'";
  if (mysql_query($sql)) {
    echo '<p>Author details updated.</p>';
  } else {
    echo '<p>Error updating author details: ' .
        mysql_error() . '</p>';
  }

}

?>


<form action="#" method="post">
<p>Edit the author:</p>
<label>Title: <input type="text" name="Title" value="<?php echo $title; ?>" /></label><br />
<label>Subtitle: <input type="text" name="Subtitle" value="<?php echo $subtitle; ?>" /></label><br />
<label>Content: <input type="text" name="Content" value="<?php echo $content; ?>" /></label><br />
<label>Author: <input type="text" name="Author" value="<?php echo $author; ?>" /></label><br />
<label>Date: <input type="text" name="Date" value="<?php echo $date; ?>" /></label><br />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="submit" value="Submit" name="send" /></p>
</form>

Try this it might work allot better.

A list of problems you had or may have had (methods that may cause problems):
- Capitals at the start of a variable $Title - SQL Statement was messy. All fields or table names should be contained with ` (key to the left of 1 but not the numpad numbers the top row)
- PHP_SELF as stated before isn't advised. Your better of using #.
- The use of if( STATEMENT ): isn't advised for newbies. Stick to the standard if( …

Josh Connerty 20 Unverified User

First make sure you have set up a username and password as it is not advisory that you use the root username and password. Then you need to connect to the database like this:

<?php
$con = mysql_connect( "localhost" , "USERNAME" , "PASSWORD" );
mysql_select_db( "DATABASE" , $con );
?>

And you should connect fine. As for the PHPMyAdmin problem, is it warning you of this error or is this just when you are connecting to the MySql server via a PHP document?

Josh Connerty 20 Unverified User

Yes but the original problem still stands, it was most liekly because MySql was triming the universities because the field will only accept one character.

For instance varchar(1) will make this happen. You could have just changed it to varchar(100) .

But I'm glad you solved the problem. ;-)

Josh Connerty 20 Unverified User

Thats fine but I am not doing it for you. Try doing it like I said and if you come accross any problems then I can help. ;-)

Josh Connerty 20 Unverified User

Selects and Radios should be fine as long as you give them the value in witch you wich to be in the database.

<input type="radio" name="you_field" value="Male" />

If you were to insert the POSTed data from my little form you would insert "Male" into the database, whereas you are using 1, 2, 3 & 4 for your values.

Please make sure that you also mysql_real_escape_string( $_POST['field_name'] ) as this will make sure MySql will not refuse any data given.

Josh Connerty 20 Unverified User

Hello Kingben,


you should include an RSS feed in your this notice board, so that any new notice will be emailed to the subscribers, do add a facility of user registration.

If there is no notice for a department, do display, "Currently there are no notices available".

Overall look and feel is good. Put a time frame for each notice, if suppose a vacant position in a student union, must have a due date, so add a due date in that section.

I haven't had much time to check but these points made sound very constructive. I'm not to sure on the RSS point though, is it really necesary? You need to think who is going to be using the RSS fead?

Josh Connerty 20 Unverified User

Oh yes and it is deffinetly more efficient to have a table with the page id's and the file source so as it's more effeciently referenced via the documents.

Maintainence should be painless with one table with two fields.

Josh Connerty 20 Unverified User

Your on the ball Josh Connerty. I would like to stay away from the data base do to maintenance. I will make it in a database if i have to.
thanks

So you wish to edit the file that contains the content for the specific page?

In this case you may want to take a look at w3schools file tutorials so we are on the same level (will provide a link).

In a sense what you will need to do is have a page with a drop down list with all of the different pages they can edit then have it post an ID to the next document. From there you will need to use the ID to open the file consistant with the ID and echo out the contents of the file to the textarea.

Then when you submit this it should take you to the preview page where it will also save the new contents to the document so you may need to post the ID of the page once more in a hidden field so as this document knows the file to reference also.

So from then on whoever goes to the page they have just edited it will be as they eddited it. And when they return they will have what they last changed in the textarea as you are reading the file before they edit it again.

The link for the w3schools tutorial is below:
http://w3schools.com/php/php_file.asp

Josh Connerty 20 Unverified User

So it is infact your HTML document and not the PHP?

To test if your PHP document is taking a very long time try taking down a time stamp at the start and the end of your PHP document.

Then at the end minus the start from the last. IF this returns false then your script is executing like it should. If it is a second or more (if the result of the maths is 1 or more) then PHP/MySql is under strain from the host machine.

If your script is executing like it should then yes it is indeed your HTML contents that are causing the long load. It is supprising that you ae not already cropping your images whern they are uploaded.

It is highly advised you crop them once and not every time you display them as this WILL cause PHP to be laggy.

Josh Connerty 20 Unverified User

Well the mail function expects their to be 4 paramaters you clearly have more.

<?php
$to = "me@mydomain.com";
$subject = "Welcome to mydomaiin";
$ip = $_SERVER['REMOTE_ADDR'];
$body = <<<EOD
<h!>Welcome to my domain</h1>
<p>Thankyou for signing up. We have documented you ip as: $ip</p>
EOD;
// Yes you can include PHP variables in that block of code.
$headers = "From: no-reply@mydomain.com \r\n";
$headers .= "Content-type: text/html \r\n";

// IMPORTANT BIT
// mail( TO , SUBJECT , BODY , ADDITIONAL_HEADERS )
if( mail( $to , $subject , $body , $headers ) ) {
echo "Message successfully sent";
} else {
echo '<span style="color: red;">Error sending message.</span>';
}
?>

This will send an email perfectly. Well it should do I have written it off of the top of my head so I can't be certain. But I have been writing these for years so this should be correct.

Josh Connerty 20 Unverified User

Have you had any experience with PHP files?

What you do is first OPEN the file. This allows PHP to read the contents and attributes it contains.

This is what you must do with your image. You need to use the functions stated above by cwarn23 depending on the file extension.

These will open the files and allow PHP to read information on the specified file. Without this your function will not work as PHP can change the information without knowing everything about this file.

createimagefromjpeg( $path_to_jpeg );

createimagefromgif( $path_to_gif );

createimagefrompng( $path_to_png );

/* I'm not 100% sure but I think there is a createimagefromjpg() function
but don't quote me on it. */
Josh Connerty 20 Unverified User

No not other than uploading it and giving it a whirl and try to fix any errors PHP stated.

I noticed your mail() function looks rather odd.

What is the error you are currently getting?

Josh Connerty 20 Unverified User

Okay then in that case you will need to use AJAX, are you aware of this?

You will need to add a javascript event to your "term" text box.

<input type="text" name="term" onkeyup="javascript: returnTerms( $("#select").val() );" />

Now every time you enter a key into this text box we will make javascript contact your PHP document to retreive the relevent information.

Now if you are happy to do a little learning then I will continue on your say. I will be using jQuery as I program JavaScript with the jQuery library.

jQuery: http://jquery.com/

So if you are happy to use this method then I will continue.

Josh Connerty 20 Unverified User

Actually am trying to provide a system for http://nitj.ac.in to publish and share Notices on the WWW. Currently they publish the Notices as individual pages (see the right hand column when you visit the site).

Being a student of the same University, I thought to take a leap forward and provide them with some easy way to share and publish the notices ....

Okay from what I can see this looks okay but I can't evaluate the real coding until I see some kind of moderation control panel or administration control panel or both if the case may be.

That is of course if you have one. This would be where the real coding lies.

The only comment I have on the proccess so far is when you click on a genre or subject to the bottom left. You are then directed to another page in the same template. Thats fine. But when you click the code or whatever it is on the right of the listed subject or whatever it is it directs you to a page that is much more simple and has a print button.

Now my thoughts are this is for a print friendly version. But it is proven people would rather see the notices or post in the full template and then (if they want to) have a print friednly link to take them to the page that is currently being displaed.

Josh Connerty 20 Unverified User

When you are saving the new content posted via the web form what exactly is it doing.

I know you are editing a page but how. Are you adding the POSTed data to a document or a MySql database?

Either way you would just pull the document they editied last and echo it out between the <textarea> tags of your form.

If this is indeed what you meant?

If so then I will be able to explain a little more and give the others a heads up on exactly what you mean. Else theres not much use me posting code for something not relative to your issue.

Josh Connerty 20 Unverified User

I do have the $_POST['term'] in the file so I am assuming that I have a syntax error somewhere.

I started the project this way because I thought this would be the elementary way to begin learning and do have plans to improve it to a relational database as I move along. This is my dads website and while the scroll bars are functional It seemed to be the ideal real world situation to learn from. Perhaps I am taking the wrong approach to learn PHP.

I appreciate your comments because it seems to make more sense to me as I further investigate the manual and other resources.

Thank you.

If it a parse error it would state so. If it doesn't either say Fatal Error: or Parse Error: .......... On Line: ... In *Document Name* or something similar.

If neither of these ar returned then it is more likely a fault in the logic as to why it is not working.

What exactly is it that is not working?

Josh Connerty 20 Unverified User

I was trying to take a look but something went wrong on either my end or the hosts.

What exactly is this intended for?

Josh Connerty 20 Unverified User

From what I can think of, you will need to block the access of the base ip. For instance mine is 192.168.2.1 now if I were to type this into the address bar of my browser whilst connected to it I would receive a log in screen (not sure about net gears) this is deffinetly a security floor for reasons you may expect.

You may have already done this but other than that theres not much more you can do to secure an unsecure wireless network.

Like the guidelines for PHP goes, "Treat it as thogh everyone is trying to harm you". A little paranoya but it's true.

Josh Connerty 20 Unverified User

If you were using JavaScript then you could remove it but if you are using just HTML then yes you would still need it.

Josh Connerty 20 Unverified User

Yes, is is possible with wordpress. You can create custom pages with the funcitonality you want, through an extension.

Josh, I wouldn't write wordpress off because it got hacked in shared hosting.

Shared hosting is usually more of the problem then the software installed on it.

Almost every account on shared hosting can be hacked, even if you use strict security measures.

ie: PHP usually runs as the same user on a single machine on shared hosting. So it can write to any file that it created, even on a different accounts.

If PHP can write to it, then anyone on the machine can write to it. It is the same for any running process on a shared host.

So when you're on a shared host, no matter how well you secure your site, if a single other site on that machine is vulnerable, your site is.

Maybe but the shared hosters technicians concluded that it was through wordpress that my websites were hacked. You can see the outcome from the following addresses:
http://jjcon.co.uk/
http://joshconnerty.co.cc/ // Hadn't even finsihed this one was a temporary domain :(
http://htmltutoronline.co.uk/
The actuall thing that caused these to stop functioning was that the index.php's (in every directory) had been cut short (about in 1/3 of the previous size) and had a hidden iframe added to it :(.