petr.pavel 19 Junior Poster

Hi Cente, I got a bit lost in your description but here're my five cents:

  • to redirect a browser to FTP use header("Location: ftp://example.com/directory/file"); . It's the same as with HTTP.
  • URL that contains username and password looks like this: ftp://user:password@example.com/directory/file
  • To assign privileges to an FTP account (e.g. to have access to a single directory only) you have to use your webhosting control panel. Or edit your FTP server's configuration, in case you're running your own box. If you want to lock an FTP user in a subdirectory so that he cannot get out of it through ".." you're looking for a chroot option.
petr.pavel 19 Junior Poster

I'm afraid it isn't possible. But if you tell us why would you ever want such a thing maybe someone will come up with a better solution.

petr.pavel 19 Junior Poster

Hi Anish, I don't quite understand your description. What do you mean by "pass null values to integer"?

PHP NULL values won't be passed to MySQL as NULL you have to explicitly type NULL.
Example:

if ($value === NULL)
  $sqlValue = "NULL";
else
  $sqlValue = "'".mysql_real_escape_string($value)."'";

mysql_query("INSERT INTO mytable (myattribute) VALUES ($sqlValue)");
petr.pavel 19 Junior Poster

Hi Anitha,
I'm sorry but "0245875224485" isn't a unicode format for anything but "0245875224485".
"Anitha" in unicode would again be "Anitha". I guess that when you try to convert Unicode to some ISO charset you will find out that it didn't help.

But let's stick to your specs. To convert a string from UTF-8 (say we're talking about UTF-8 here; "unicode" is rather a general word and can mean more than one thing) to ISO-8895-2 (I don't know what your "original" charset was) you can use iconv() function:

$converted_8895_2 = iconv("UTF-8", "iso-8859-2", $utf8_string);
petr.pavel 19 Junior Poster

Hi, please tell us what's wrong with the code, or what do you want from us.

petr.pavel 19 Junior Poster

Hi there, I don't see that you'd be using $gametype or $gamesize. Could you please add some code that proves that they are empty indeed?

Also did you try displaying $_FILES? Add var_dump($_FILES['game']); to see what's in there.

Your HTML code doesn't end the table and the form. Also you should use attribute="value" notation and not attribute=value. Lazy programming is the best way to introduce bugs that are very difficult to trace.

Because your HTML doesn't contain any variables, you don't need that echo "" wrapper around it. Just quit PHP source code with ?> have the HTML code and then enter PHP source code again with <?php

You shouldn't use $_POST[title] - $_POST["title"] is better (title would first be tried as a constant).
If you place

ini_set("display_errors", true);
error_reporting(E_ALL);

you'll see what other mistakes you've made.

petr.pavel 19 Junior Poster

Hi there,
locate httpd.conf and change
Listen 80
to some other port number, for example
Listen 81

After starting up your Apache you'll be able to reach it via http://localhost:81

petr.pavel 19 Junior Poster

Hi there, could you please let us know what isn't working? I.e. what is the behaviour you expect and what is it doing instead.

BTW: Are you sure you need all that JavaScript hassle with onClick on the checkboxes?

Maybe you don't know what is being submitted. For example here:

<input type="checkbox" onClick="document.myform2.w0.value = this.checked">
<input type="hidden" name="w0" value="50">

If clicked w0 will be assinged "true". Otherwise it will keep "50". Also if I click the checkbox and then click it again (to uncheck it), w0 will still hold "true".

Why don't you use just

<input type="checkbox" name="w0" value="50">

If checked w0 will contain "50". If unchecked then w0 will not be submitted - use if (isset($_POST)) in your script to test it.

To see what your script is getting put var_dump($_POST); somewhere into your script.

petr.pavel 19 Junior Poster

Hi, first let me suggest that you should think of some less complicated way of displaying the data. I guess you could achieve the same result with just about twenty lines of code.

But to answer you questions:

  • The main problem probably is that you have echo '<tr>... inside of all your three loops. So it prints a row of all seven days for each day and term - which isn't what you want. There's no simple solution for this. I suggest you rewrite it into a single query for all days using SQL construct week_day IN (0,1,2,3,4,5,6) and then convert the results into two-dimmensional array: $data[$orderNumber][$row->weekDay] . Then traverse $data in two loops: one for each row of the array and second for each day of the week.
  • for($wk_day =0; $wk_day < count($all_avail_days); and foreach($all_avail_days as $key => $avail) does the same only using a different construct. So you are basically looping the same thing twice.
  • maybe you're referencing the array items wrongly - use $all_avail_days["$wk_day"][$key]["start_time"] instead of $all_avail_days[$wk_day][$key][start_time] Reasoning: $all_avail_days["1"] is something else than $all_avail_days[1].
  • $type_start_time7 -like variables aren't cleared after being used so you may be printing old values from previous loops. You should have else for each if($day == ...) where you clear the variables: $time_id7 = $type_start_time7 = $type_end_time7 = $colour7 = NULL; Or you can get rid of them completely and use the directly $all_avail_days["$wk_day"][$key]["start_time"] stuff with printf()
  • You may also want to use ORDER BY in …
nav33n commented: Good point. +6
petr.pavel 19 Junior Poster

Hi there,
I run PHP on a Windows box but with Apache (very easy to set up with XAMPP http://www.apachefriends.org/en/xampp.html).
I didn't hit this problem even though I worked with osCommerce.

Could this be the solution for you?
http://www.somacon.com/p255.php

petr.pavel 19 Junior Poster

Hi Peter,
you could use your webhosting's SMTP server but PHP doesn't support SMTP authentication out of the box. You have two options:
a) Either you will use your Internet provider's SMTP server (your home/work ISP) because then I believe you won't have to use SMTP authentication (authentication is usually done by your IP address)
b) or you will use a library like XPertMailer http://www.xpertmailer.com/ instead of PHP built-in function mail(). Then you will be able to use SMTP authentication and a SMTP server of your choice.

Let me know if you need any more details.

petr.pavel 19 Junior Poster

check for viruses:

  • your hosting must be allowed to execute files (which I seriously doubt)
  • you have to know where the antivirus program is and what parameters it expects
  • then use exec() to run it

ftp:

  • your script can use FTP if PHP has been compiled with FTP support - but that's likely
  • but it wouldn't solve your problem - you would need your users to use FTP instead of HTTP upload

To let your users upload files via FTP safely (safely for you, not for them), you need this:

  • set up a separate FTP user with access only to a specified directory (so that he cannot mess with your scripts)
  • this directory must not be allowed to run PHP scripts (best if it's outside httpdocs) otherwise someone will misuse it to run a spam-bot
Scottmandoo commented: For continuously helping me out, thanks heaps +1
petr.pavel 19 Junior Poster

If you are going to do only what you do now: move the file from temporary location to permanent location then yes, set only these three ini attributes.

If you are going to process the ROM files though, (extract something from it or rearrange it) then you will also have to set memory_limit and max_execution_time.

petr.pavel 19 Junior Poster

Hi Ctoz, there is JS/AJAX forum here:
http://www.daniweb.com/forums/forum117.html

I don't quite understand what you posted but I noticed "ActiveXObject" - ActiveX isn't supported in Firefox unless you install some plugin (I haven't tried it).
Mozilla/Firefox uses XMLHttpRequest() for http requests from JavaScript.
http://www.phpbuilder.com/columns/jon_campbell20070808.php3

simpleajax.js seems to support it so I don't know what's wrong.
I don't feel like debugging your script so you're on your own here. Really, try Venkman (see my earlier post).

petr.pavel 19 Junior Poster

Hi Scottmandoo,
I'm a bit confused. Are you saying that the total file size of all files in your hosting must not be higher than 8 MB? Boy that's not much :-) Try http://pipni.cz/ - you get 1.5 GB there for free (it's a Czech server but you can switch the language to English).

If your limit for all files really is 8MB then you have to modify your script to check what the file size of already uploaded files is.

Let's assume that you want to limit max size of the file being uploaded to 7MB:
upload_max_filesize 7M
post_max_size 7M
(If you are going to read the file into memory then set memory_limit too.)

Now let me show you how you are going to calculate the other two:
We have to decide what is the slowest Internet connection that you will support. Let's make it 256 kpbs (uplink), for instance.
Here's the formula:
y = (256/8) speed in kilobytes per second
x = (7*1024 / y) how many seconds it would take to upload a 7MB file
Result is: 224 seconds
This would be true if your customer is able to use full this theoretical speed throughout the whole upload time which is impossible. So I suggest that you multiply it by 1.5 to provide some cushion.

Your value would be then 336 seconds:
max_input_time 336
You don't have to touch …

petr.pavel 19 Junior Poster

Hi Ctoz,
I'm surprised that hello.php and insert.php return the source code and not the output of the code after execution. For instance, hello.php should just output
Hello world
while insert.php should fire an error because you put ?> after HTML and not before it. So my guess is that your hosting doesn't support PHP.

But it's not the problem you're dealing with right now. Your current problem is JavaScript related (this is a PHP forum).

The JS library you have is version 0.1 beta. I was hoping to find a newer version http://simplejs.bleebot.com/ but apparently, this is the latest.

I didn't find the error. The file is difficult to read because it has no indentation so I suggest that you add it as you debug the script. Best if you install Venkman https://addons.mozilla.org/cs/firefox/addon/216 and set up a couple of break points.

Before you do, try using full url in $ajaxreplace('updatehere','hello.php',false); Instead of just 'hello.php' try 'http://www-personal.usyd.edu.au/~ctillam/tests/PHPsimpleTest/hello.php'.

Good luck.

petr.pavel 19 Junior Poster

when user signs in keeps saying "Wrong Username or Password";

So what did you do to try to find out why? C'mon, we're not going to do your homework for you, we can just explain things if you ask specific questions.

Try to insert echo $sql; after $sql="SELECT * FROM members WHERE username='$myusername' and password='$encrypted_mypassword'"; to see what's being executed. Then you can execute the sql yourself and see if it returns something.
This way you will verify that:
* username and password is properly submitted
* a db record for this user really exist - and there's only one, not more of them
* the query is correct

My impression is that you're just starting with PHP and you're trying to jump right into the middle of a project without learning the basics first.

petr.pavel 19 Junior Poster

I'm sorry I got lost in your post so let me reword it.
Let's say that you have pages homepage.php, courses.php, students.php and you want to protect all three - valid username+password is required to access them.
So you put the session_start()... code into each.

When someone opens one of them and is not logged in, he will be redirected to locationtudentLogin.php - that's the page with $host=...
He will log in there and stay logged in even when he leaves the page. Then he can access one of the protected page and he will see their content.

Is it clearer now?

petr.pavel 19 Junior Poster

Hi Shezz,
so you run savevote.php and it still won't save the vote, right? Does it show any error message?
The script makes sure that you vote only once so perhaps that's why - you're trying to vote more than once.

Or maybe DOMDocument isn't supported in your PHP installation. Or the link to savevote.php is bad and doesn't contain variable "votefor".

Can I see it somewhere live?

petr.pavel 19 Junior Poster

Hi there,
the key is this line in your CSS: .unit-rating li a:hover You cover the other A's with the active A. Change z-index:20; to say 10 and it will show below not over them. (tested in Firefox)

The number is off the box because it is right aligned while other A's are not. There's no easy solution to this. You could right-align all A's (not just the a:hover) but that wouldn't look good. So after you change the alignment, you could put a padding <div> inside of all <a></a> or add a couple of &nbsp; after each number.

P.S.: This thread is about PHP, not CSS or JavaScript.

petr.pavel 19 Junior Poster

Hi Sukhy, your post looks more like a project specification then a problem description. If you want me to program this thing for you, I'll do it for 40 USD per hour. I would give you price estimation after we would get together some proper specs.

If you have some specific problem though, please invest more time into describing exactly what it is. Advices are free.

petr.pavel 19 Junior Poster

Hi there, I'm a bit confused:

  • I don't see a reason for calling session_start(); session_destroy(); I'd say that you can safely ignore this
  • The other "Put this code in first line of web page" is correct though. All your protected web pages must have .php extension and contain this as the first thing in the file
    <?php
    session_start();
    if (!session_is_registered("myusername")) {
      header("locationtudentLogin.php");
    }
    ?>

Otherwise the code seems to be ok, let me know if you're having any problems.

petr.pavel 19 Junior Poster

Hi there,
are you running the server yourself? I mean if you're on a normal commercial hosting you're not allowed to modify php.ini. You cannot create your own php.ini - only one php.ini is The One.

If you are running your own server then maybe you have modified wrong php.ini. Sometimes there are various copies of php.ini laying around the box due to for example, having both PHP4 and PHP5 installed. To verify that you got the right php.ini run phpinfo().

Or the script you're trying to install has a bug and thinks register_globals is disabled while it is not. What script is it?

The directive you used for turning register_globals on is correct so it must be something else. .htaccess has nothing to do with it.

petr.pavel 19 Junior Poster

Hi Ctoz,
I suppose that your server supports PHP (e.g. your hosting plan includes PHP). A PHP script must (under normal circumstances) be saved in a file with extension .php and the script inside of it should be wrapped in <?php and ?>.
I suggest you start with a simple PHP script to verify that PHP is working fine on your server. Save this into test.php, upload it onto your server and run it by typing its address into your browser.
http://yourserver.com/yourpath/test.php

<?php
echo 'Hello world';
?>

Now that you verified that PHP is running fine do the same with text1.php. You should first see that it returns what you expect before you start using it with JavaScript.

If text1.php doesn't run add this at the top (after opening <?php) to see error messages:

error_reporting(255);
ini_set("display_errors", true);

Then paste the errors here and I'll tell you what's wrong.

petr.pavel 19 Junior Poster

Hi there,
because you posted your database login info here you will have to change it. Otherwise the first hacker who happens to read this (e.g. using an automated search script) will either erase your database or fill it with malicious data.

Now back to bug hunting: I suggest you keep

ini_set("display_errors", true);
error_reporting(255);

at the top until you solve all problems.
This should show you what is the reason for getting a blank screen.

The 2MB is default file upload PHP limit, that's why it didn't affect you when you used FTP.
It's very likely that you aren't allowed to change this settings unless you have a very benevolent hosting provider. If you are though, then you have these options:

  • If you run the server yourself then locate php.ini and edit upload_max_filesize, post_max_filesize, max_execution_time, max_input_time and memory_limit. I'll explain them later.
  • Or if your server runs web server Apache and .htaccess parsing is on then put file .htaccess into the same directory as your script. Its name really starts with a dot. Some FTP clients don't show unix hidden files by default - and hidden files = dot files. So don't be surprised if you upload the file and don't see it then in the listing. Check your FTP client settings. This should be in it (use your own values):
    php_value upload_max_filesize 100M
    php_value post_max_size 100M
    php_value max_execution_time 1800
    php_value max_input_time 1800
    php_value memory_limit 100M

    Note: I think you have to use Unix line …

petr.pavel 19 Junior Poster

Thanks for the syntax highlighting it's much better.
The errors you are getting aren't deadly. So why do you think there's something wrong with the script?

Looking at the script I have a few suggestions:
* don't use copy() for moving uploaded files as most hostings will not like it.
First test if the upload was successful:

if (is_uploaded_file($_FILES['rom']['tmp_name'])) {
}

and then move it with

move_uploaded_file ($_FILES['rom']['tmp_name'], $romName);

* $romName most likely doesn't contain a valid path
It should be
/www/10gbfreehost.com/b/l/a/blastburners/htdocs/gba_roms/files/....
not just
/gba_roms/files/...

Best if you use $_SERVER["DOCUMENT_ROOT"].'/gba_roms/files/'...

* you should move mysql_close() two lines higher just after mysql_query()
Now it attempts to close a non-existing connection if $error > 0.

* you shouldn't insert values taken from $_POST/$_GET directly into database without running it through mysql_real_escape_string(). A hacker could use this security hole to wipe out your database or replace its content with malicious data.

petr.pavel 19 Junior Poster

Hi Kevin,
you will have to change your db login data because now that you posted them here anyone can connect to your database and do whatever he wants.

I ran db.php and I got a valid connection.
To verify it I put this to see what was the mysql_pconnect() result.

var_dump($connection);

Because db.php already connects, you don't have to connect again in your main script. $connection will be available in the main script.
Frankly, you can just not use $connection at all - if you don't need more than one connection in your script.

You don't have to run mysql_select_db() each time before you use a database. It's enough to run it just once in db.php and it will stay selected. You only need to run mysql_select_db() again if you want to use a different database.

The error that you were looking for was $dbusername versus $dbuser - you define and use different variables. The proper solution is to remove the second connect attempt.

Also, you don't need to run mysql_close() at the script's end because you're using permanent connections mysql_pconnect() and they are not affected by mysql_close().

petr.pavel 19 Junior Poster

Hi Scottmandoo,
best if you place this at the top and run it:

ini_set("display_errors", true);
error_reporting(255);

Then you could post the error messages and I'll explain what they mean.

Also, could you please edit your post and add "=php" into the tag code (code=php)? It will tell this forum to use PHP language syntax highlighting and the source code will be much easier to read.

As a bonus, here's a simpler getExtension() function:

$extension = strtolower(substr(strrchr($file_name, "."), 1));
petr.pavel 19 Junior Poster

Hi Kevin,
there's no way we could check the problem remotely.
Either you have the login data wrong (server name, username, password, db name) or the script doesn't connect or I don't know. Can you attach both db.php and the main script?

petr.pavel 19 Junior Poster

The query for inserting is:

INSERT INTO yourtable (user_id, points, round, game, winner, comp_id) VALUES (23, 0, 1, 1, 'hawthorn', 3);

I assume that attribute id is your primary key with AUTO_INCREMENT so it gets its value automatically.
To run the query in PHP:

mysql_query("INSERT .... ");

You have to be connected to the database - see manual entry for mysql_query().

petr.pavel 19 Junior Poster

I'm sorry, I didn't mean to be sarcastic. I apologize. I was just confused.

What's wrong with the code I gave you?

petr.pavel 19 Junior Poster

Hi Anasta,
I must be missing something because to me, the answer is very simple:

...
echo '<form action="saveme.php">';
echo "<tr>";
echo '<td><input type="checkbox" name="gameId" value="'.$row['id'].'"></td>';
echo "<td width='25' align='center'>" . $row['game'] . "</td>";
echo "<td width='150'>" . $row['home'] . "</td>";
echo "<td width='150'>" . $row['away'] . "</td>";
echo "</tr>";
echo "</form>";
...

So what am I missing? :-)

petr.pavel 19 Junior Poster

Hi Kevin,
the basic question: do you store the images in a database or as files in a file system.

Also, what should I imagine when you say "the variable name which was set for the images"?

petr.pavel 19 Junior Poster

All right, I can see that you know what you're doing :-)

Since your hacking it anyway, we won't mind using eval(), will we? (yuck!)

$string = "level1.level2a.level3=10";

list($combinedKey, $value) = split('=', $string);
$keys = split('\.', $combinedKey);

$command = '$config["'.join('"]["', $keys).'"] = $value;';
eval($command);

var_dump($config);
JRSofty commented: Very helpful. +1
petr.pavel 19 Junior Poster

That's it. You said you have a linux box so you have to locate sendmail - I assume that you have it installed. To find where your sendmail is run:

locate sendmail

then uncomment the sendmail_path row and enter the full path incl. the switches. For example:

sendmail_path = /usr/sbin/sendmail -t -i

That should do.

Just curious: are you able to send e-mails from the box using pine or mutt? PHP usually works with default settings just fine if sendmail isn't installed into some unusual location. What I mean is that you could in fact, be having a sendmail problem, not PHP configuration problem.

petr.pavel 19 Junior Poster

Hi JRSofty,
before I think about a solution to what you want, let me cast some doubts on it first:
Is it really so time saving to have your config code instead of good ol' php?

$config = array(
  "access" => array(
    'read' => array(1,2,3),
    'write' => array(1,2),
    'modify' => array(1,2)
    'manage' => 1
  ),
  "somethingelse" => 10101
);

With your method you have all strings. No NULL, boolean or other types.

petr.pavel 19 Junior Poster

Hi maydhyam,
if you use a professional hosting (someone has set up the server for you) you don't have to worry about anything. Just use mail().

If you're running your own server (e.g. development server) then you need to check php.ini section [mail function]. For Linux you have to verify that sendmail_path is correct.

petr.pavel 19 Junior Poster

Hi dwlamb_001,
I use xampp myself and I do have MySQL and Apache installed as services. Your situation could be different though.

Starting MySQL from xampp control panel should be just fine, although I'm not sure if MS DOS window pop ups and stays open for you to read error messages if there are any. If it doesn't show up or stay open, you'd probably want to find the executables that do the starting and run them in MS DOS window manually. I'm pretty sure the Control panel is just GUI, it just calls executables to do the requested work.

On my system these executables are:
C:\xampp\mysql_start.bat
C:\xampp\mysql_stop.bat

Because you said you wanted to run xampp and wamp (I'm not familiar with this one) with the same MySQL server, I deduce that you already had MySQL installed on your box. So perhaps xampp executables were trying to start MySQL from xampp distribution which you didn't install. Or worse, you did install another MySQL with xampp and it collided with your old MySQL server.

In order to run two different MySQL servers, you have to tune up their configuration file my.cnf so that they listen to different ports (I'm not sure about socket numbers, hopefully they're assigned automatically) and use different data directory.

I'm not sure but it appears to me that we came to an end. Could you please mark this thread as closed? Or ask more questions if you have any.

petr.pavel 19 Junior Poster

Hi vijukumar,
your source code would be much easier to read if you used code tags when pasting it into this forum. Please edit your post and add them.

I noticed that you incorrectly name the input fields:

echo "<input name='$company_name' type='text' value='$company_name' class='typeforms'>";

You should remove the first dollar symbol:

echo "<input name='company_name' type='text' value='$company_name' class='typeforms'>";

I don't know what database wrapper you're using so I can't tell you which method you should call for a simple query execution. Attach the source code if you want me to have a look. The simplest method would be

mysql_query("update invoice set company_name='$company_name'
where invoice_id='$line'");

This would update only the company name, of course. You have to add other attribute=value pairs for other attributes. Also, it's better to use $_POST or more general $_REQUEST arrays because $company_name will contain your form values only if register_globals is on.

Also it looks like you're not passing $line variable in the form. Add a hidden attribute with $line value.

I guess this answers all your questions, doesn't it? Let me know if I missed something.

petr.pavel 19 Junior Poster

Hi Camdes,
I must be missing something. If you managed to write a thumbnail creating code there must be something awfully difficult about making the 3x4 table.

Anyways, here's my code (cut from my existing script that displays links in a grid):

$columnsNumber = 4;
  // there will be as many rows as necessary
  print '<table class="links_table"><tr>';
  $i = 1;
  while ($link = mysql_fetch_assoc($links_db)) {
    print '<td>yourthumbnail</td>';

    if ( ($i % $columnsNumber) == 0)
      print "\n</tr><tr>\n";

    $i++;
  }
  if ( (($i-1) % $columnsNumber) != 0 )
    print "<td colspan=".($columnsNumber- (($i-1) % $columnsNumber))."></td>\n\n";

  print '</tr></table>';

It's so short that I don't thing comments are necessary. However, let me know if you need them.

petr.pavel 19 Junior Poster

Hi Flaco,
it looks to me like you didn't edit includes/config.php to enter MySQL login information.
So go to your Control panel, find out the database name, user name and password and fill it in there.
You may have to create the database first, most web hostings don't create one for you by default.

petr.pavel 19 Junior Poster

Hi Dami,
I'm sorry but I didn't understand :-)

Correct me if I'm wrong please:
- you have three types of users: students, tutors and admins
- each of the users should see different menu
- everything works ok except for the menu: all users see the same - students' menu
Right?

I assume that this script isn't publicly accessible (you cannot give us URL - http://...) so could you at least post screenshots of the three situations and perhaps draw a circle in a graphical editor around the areas that are wrong?

Try write your description in a structured way, a list with items, just like I used above, as opposed to one long paragraph of text. It'll help you organize your thoughts.

I'm sure we sort it out in the end.

petr.pavel 19 Junior Poster

Hi Keith,
I'm afraid you'll have to attach the two scripts that you're using :-)

I'll have a look then and hack them together if it's not too much work.

petr.pavel 19 Junior Poster

Hi nishanthaMe,
this is a last-hope advice.
I found on Wikipedia that Wikipedia itself uses this algorithm:
http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm
So you could download Wikipedia source code and find it in there.

petr.pavel 19 Junior Poster

Hi John,
I'm reluctant to believe you on the spaces issue with readdir(). I checked the manual and nobody in the discussion has ever mentioned it. Maybe you think that it skips the files but in fact, something else down the road in your script does.

Anyways, try using glob() instead. It will make your script look prettier :-)
Something along these lines:

$pattern = "$dir/*.txt";
$files = glob($pattern);
var_dump($files);
...
petr.pavel 19 Junior Poster

I do realize this was a fake post and an advertisement (judging from the snipped signature) but I'd like to add my five cents anyway, because the method described above is pretty crude.
An easy and elegant method is:

include dirname(__FILE__)."/ws8_extensions.php";
include dirname(__FILE__)."/ws8_functions.php";

BTW: Thanks for removing the ad. When we're at it, how about to close the thread as well so that it doesn't appear in unanswered threads search results? Thanks.

petr.pavel 19 Junior Poster

Hi Dave,
you're not giving us the whole script, are you?
$sendmail should be defined somewhere. That's where your path to sendmail goes.

BTW: This method of sending e-mails is bad, read something about e-mail injection:
http://en.wikipedia.org/wiki/Email_injection

If you you're still having problems with sending through sendmail (it could be that -t is forbidden, for instance) and you cannot use built-in mail() function (the easiest way ever, although even there you have to care about e-mail injections) I recommend using XPertMailer library:
http://xpertmailer.sourceforge.net/

It may be a bit of a hard nut for you to crack at first as you are probably a PHP beginner, but the reward is worth it. You can for instance, send HTML e-mails with it like a breeze, or send e-mails using the recipient's mailserver (read from MX query).

hbmarar commented: nice +3
petr.pavel 19 Junior Poster

Hi vijukumar,
just because you press a button, nothing is going to be executed unless you program a script that does it (connect to a database, build the UPDATE query from FORM values and executes the query against the database). Maybe you're using some framework that does it for you but then you probably don't need to know the query as the framework should do all the work for you. You probably 'only' need to know more about the framework to know what is its built-in function for updating entities that you display in an edit form. Can't help you with this.

The final query will look something like this:
UPDATE `invoice` SET company_name = 'blah blah', issue_date = 123, .... .... WHERE invoice_id = 456;

Like I said, this is useless for you unless you have a script that fills in the attribute_name = attribute_value pairs.

petr.pavel 19 Junior Poster

Hi Inny, read the whole reply to find the error at its end. I'll keep the rest of my original post to show you my track of thoughts which could be helpful for you some other time.

Maybe fopen wrappers aren't enabled. (file('http://...)
Or maybe short_open_tag is off. (<?php versus <?)

Try placing this at the top and call it not with the <script> tag but directly:

error_reporting(255);
ini_set('display_errors','On');

Well, I just called it directly and there are run-time errors that tells you what's wrong:
http://h1.ripway.com/Inny/chat.php

It's difficult to count for me which line is the 13th but I guess you placed a backslash before parenthesis and not before quotation marks:

echo "document.write(\","\)";

You should use a text editor with syntax highlighting (e.g. http://www.pspad.com/). Even DaniWeb syntax highlighter would have pointed out the error for you.

Happy coding.

petr.pavel 19 Junior Poster

... a php script for integrating the news websites to my webpage. I found the scripts on Internet. What I need is the channel, a path linking to the news site. The news will be updated automatically after signing the contract with the sites to be linked.

So here's how I understand it:
You have a set of php scripts that downloads news from several sources and displays them on your website. Now you need another script that would combine news from all your sources into one RSS channel.

I'm sorry but you can't do that without understanding PHP and the scripts that you use for downloading news. There is no simple solution. Such a script doesn't exist out of nothing. You have to program it. I'd say that you should hire someone to do it for you.

I would do it for you if you want, but for a price. If you are interested then please send me a link to your website and source codes of the php scripts to petr.pavel@pepa.info. I will give you a price estimation then. As I'm sure I will also have to talk to you about details, it would be great if you have Skype or something similar.

I'm sorry that it's not as simple as you hoped.