Please help me fix this!

Ok, first let me say hello, and thanks for viewing this. I do not know very much about PHP at all, and therein lies the problem… I was editing a php document for my friends website. All I was doing was adding a line of code so that his site would include a favicon.

I right-clicked on the website and viewed his source, and copied all the code into notepad, added the string of code for the favicon, and uploaded it to his FTP.

Unfortunately when I did that I overwrote some of the PHP code I believe…it didn’t copy that when I viewed the site source.

I want to make it right for my friend and fix his website but I have NOOOO idea what to do… So I have turned to this forum for help…

This is my friends website: thcklan . com

The “recent topics” and “recent posts” at the top, the “hackers banned from our servers,” and the “announcements” no longer update properly…

It’s like they are frozen at the state they were in when I copied the site’s source code… I feel like an utter jack **** for ruining my buds front page.

Please, I am asking you from deep within my heart, HELP ME, point me in the right direction, or guide me in some way to make it right to my good friend and fix his site!

a) Ask the hosting provider to retrieve the file from the previous backup.
b) Your friend might have the source code somewhere, ask him to upload the previous version.

Thank you! I passed on the info to my friend… He has sent a message to his hosting provider, so fingers crossed there.

also another question

is PHP complicated to learn? can someone with basic html experience learn enough PHP to fix something like that? (in a short amt of time)

PHP is not complicated to learn but, it takes time to get good at it and helps alot if your good at html, and from what it sounds i dont think solving this problem will be too hard if you can get the original php code

No, not unless you know what code was in that file in the first place.
There might have been heaps and heaps of PHP code, or just a couple of lines. As it’s code that has been written by someone else, it might be very easy to rewrite/ replace (although it will take a lot of time) or itmight be the most complicated bit of code ever.

Off Topic:

It’s the same as saying “I just threw the cake away and I don’t know the recipe and I can’t bake. Can I learn to bake quickly to replace the cake?” :slight_smile:

There is, of course, no cake. :slight_smile:

If you literally copied the PHP source and only added the icon it is impossible that something could have been broken in the process. Are you certain this was not a pre-existing issue or might have changed something else in the process? The only way something could have broken is with one of those cases. Changing a favicon (HTML) isn’t going to break PHP.

My guess form his explanation is that he viewed the source in the browser, meaning he only copied the html that the PHP outputted… and not the actually PHP code.

The PHP never gets through to the browsers, it gets excecuted on the server and it sends it result (html, javascript, css) to the browser.
If you want to view the PHP code you need to download the file from the ftp server and not view it through the browser`s “view source”

Yep, that would break the entire thing.