petr.pavel 19 Junior Poster

I haven't been working with cake shell script for a while but in my last project (CakePHP 1.2.5) I had to cd into the app directory first. Then the script placed the files where they belonged. So make sure you're in your "app" directory before executing cake.bat.

I just noticed that you can tell the script where your "app" directory is with -app parameter. Try this if you can't/don't want to cd to app first.

petr.pavel 19 Junior Poster

It depends on how you want to process the information after it has been stored. If you plan to use complex queries like "students who like (music AND (sports OR adventure))" then the only viable solution is 1:n - having a db table of relationships between students and their interests. A record would exist for each student and each of their interest. (Not for interests they don't have.)

A simpler model could be used if you only need to ask simple questions like "does this student like music? yes/no", or get me all students who like music. You could then have a single attribute for a student where you'd list all of his interests, comma separated.

Name    Interests
Petr    sports,entertainment

The query would then look like this:

SELECT * FROM students WHERE CONCAT(',', interest, ',') LIKE '%,music,%'

If speed is crucial then you could make the attribute of type SET (MySQL only afaik) and search it using FIND_IN_SET(). The disadvantage is that you have to list all possible values when creating the table so if you need to add/remove some, you have to alter the table structure.

petr.pavel 19 Junior Poster

Thanks for describing what each file does.

The bug is in Student_Takeanexam.php:

for ($i =1; $i < 5; $i++) {  
 
  echo "<input type=\"checkbox\" name=\"choice[$i][]\" />{$info['Que_Choice'.$i]}<br />\n";  
  $intnumber++;
}

It should be choice[{$info}][$i]

And then in Test_Completed.php:

$questionId = $info['Que_ID'];
$choice = array();
for ($i =1; $i < 5; $i++) {
  if (empty($_POST['choice'][$i])) {

it should again be $_POST[$questionId][$i] (just as I had in my code).

Next time you're getting unexpected values in $_POST try var_export($_POST); It will show you all that has been submitted. In this case, you would notice that you're not submitting unique values for each question.

petr.pavel 19 Junior Poster

Mhm, I expected three files:
- form display page
- submitted choices saving page
- database dump

What are all these files? Please bear in mind that I want to spend like 10 minutes on this so please try not to waste my time.

petr.pavel 19 Junior Poster

Click Use Advanced Editor and then Manage Attachments below the editor area under Attach Files.

petr.pavel 19 Junior Poster

I don't think this would happen with the piece of code I gave you. Could you please attach a complete source code? I will have a look.

It would also help me if you could attach a database dump. Thanks.

petr.pavel 19 Junior Poster

xxreenaxx1, you're trying to read $_POST["choice1"] but that's not what you submit. You named your checkboxes choice[{$info}.$i][] so you'll get something like
$_POST[0]
$_POST[0]
$_POST[0]
$_POST[0]
(example for Que_ID 12; only if all checkboxes checked)

Try var_export($_POST); It will tell you exactly what has been submitted.

I guess you could just name the checkboxes choice[{$info}][$i] which will submit
$_POST[12][1]
$_POST[12][2]
$_POST[12][3]
$_POST[12][4]
which is easier to use.

What I meant by my previous post was something like (using the new naming mentioned above):

mysql_data_seek(sqll, 0);
while($info = mysql_fetch_array( $sqll )) {
  $questionId = $info['Que_ID'];
  $choices = array();
  for ($i =1; $i < 5; $i++) {
    if (empty($_POST['choice'][$questionId ][$i])) {
      $choices[$i] = 0;
    } else {
      $choices[$i] = 1;
    }
  }
  mysql_query("INSERT INTO youTableName (Que_ID, Ans_Choice1, Ans_Choice2, Ans_Choice3, Ans_Choice4, Use_ID) VALUES ($questionId, {$choices[1]}, {$choices[2]}, {$choices[3]}, {$choices[4]}, '".$_SESSION['username1']."')");
}

I don't understand what is the function completed() in your last post but I guess it doesn't matter now.

petr.pavel 19 Junior Poster

If I get it right, your issue is that unchecked checkboxes don't submit so you never receive a value if the checkbox is unchecked, right?

I suggest not browsing the submitted $_POST array but use the same loop you used for building the checkboxes (MySQL query result). Then for each option, see if a value exists in $_POST - it would mean a checked checkbox. If the value is missing then it means the checkbox was not checked.

petr.pavel 19 Junior Poster

Hi andrewliu,
you will have to set a limit one way or another:
a) either you say "show max $x rows per column
b) or split the output into $y columns

I guess you prefer (a).

There's no (widely supported) HTML tag for columns so either you will have to use a table and TD for each column, or use floating DIVs and style them with CSS.

Either way, when ending one column and beginning another one, some HTML code must be printed: end current, UL, end TD or DIV, begin new TD or DIV, begin new UL. You could do this in the while loop but the code will look better if you choose to preprocess your data first and use foreach.

/*
 * First read your data and group it
 */
$maxRowsLimit = 123; // set your limit here
$groupedRows = array();
$rowsPerGroup = $groupId = 0;
while ($row = ....) {
  if (++$i > $maxRowsLimit) {
    $i = 0;
    $groupId++;
  }
  $groupedRows[$groupId][] = $row;
}

/*
 * Now display the groups as columns
 */
print '<table><tr>';
foreach ($groupedRow as $rows) {
  print '<td><ul>';
  foreach ($rows as $row) {
    print '<li>'.$row.'</li>';
  }
  print '</ul></td>';
}
print '</tr></table>';
petr.pavel 19 Junior Poster

Hi AntiQuark,
the first array item will always contain the whole captured area so for getting the individual parts, you need to start with key 1.

In your case I would try simplifying the regexp by making it more universal. Let's say it's a sequence of key=value separated with |.

For parsing it I would use (not tested)
\{\{([^=]+=([^\|\}]+)[\|\}])+\}

It says:
1. starts with {{
2. ignore until =
3. then capture everything up to | or }
4. repeat 2. and 3.

You would then need to process the $st array and keep only what you want.

For testing regular expressions, try the java applet here:
http://myregexp.com/
I use this software as an Eclipse plugin.

petr.pavel 19 Junior Poster

Hi lit108,
your code doesn't show where you get the XML string. Are you calling
addFeeds() with $urls from the first snippet?

If you don't modify or create the XML then the XML stored in the database must already be bad. It's probably not that 'more than 2 urls' trigger the bug, but the particular XML string that you added is buggy.

It could even be that the XML you store into the db is ok but the db field name is too short (e.g. VARCHAR(255) instead of TEXT) and it gets truncated.

You should try printing $feed that you pass to SimpleXMLElement() and post here the string that triggers the error.

btw: Array keys from $urls are not used so you can ignore $row[0]. Also, for clarity, use $row and not $row[number].

petr.pavel 19 Junior Poster

Hi vijiglad, you can't directly copy from a server to a server without the file going through your server (not with PHP).

The solution is to split the procedure into two steps:
1] download to a temporary location on your server
2] upload to the target server and then delete the temporary file on your server

For help with using FTP in PHP have a look at examples for functions ftp_get() and ftp_put().

http://cz.php.net/manual/en/function.ftp-get.php
http://cz.php.net/manual/en/function.ftp-put.php

petr.pavel 19 Junior Poster

Please don't create multiple threads with the same question.
Here's your answer:
http://www.daniweb.com/web-development/php/threads/352655

petr.pavel 19 Junior Poster

Hi Jacob,
the query for creating the database would be
create table login
`name` varchar(255),
`user` varchar(255),
`pass` varchar(255),
`birthday` date;

Please consider encrypting the password using MySQL function PASSWORD(). If your site gets hacked you won't compromise your users passwords. (It will be enough that the hacker gets their e-mails.)

I'm confused by the latest query. It uses a field 'username' but you ask for 'user'.
Also, the WHERE clause contains a hard coded value, I guess you were just testing.

I'm not sure if you know that UPDATE is for changing an existing record. INSERT is for creating a new one. If this is a 'register new account' kind of form then you want to use INSERT and not UPDATE here.

I don't see where you combine
$update_mybirthmonth, $update_mybirthday and $update_mybirthyear into $birthday.
I guess you wanted to write something like

$birthday = $update_mybirthyear.'-'.$update_mybirthmonth.'-'.$update_mybirthday;

Instead of the sequence of >=1 <= 31 (which doesn't take into account variability of number of days per month), try PHP function checkdate().

The gender select box has a wrong name. It's called update_mybirthmonth which eventually overwrites the previous select box' value.

petr.pavel 19 Junior Poster

Hi xxreenaxx1, first off: a code that isn't indented properly is hard to read. Please help us help you, and write code as

if (...) {
  ...
  ...
}

and not

if (...)    {
...
     .... }

Anyway, this is how you insert values into a database:

mysql_query("INSERT INTO youTableName (Que_ID, Ans_Choice1, Ans_Choice2, Ans_Choice3, Ans_Choice4, Use_ID) VALUES (numeric_value, 'string_value', 'string_value', 'string_value', 'string_value', numeric_value)");

This doesn't protect you against SQL injection though. You should use mysql_real_escape_string() for each value you pass to MySQL. The code will get cluttered but still better than having your website hacked. The ultimate solution is to use some database wrapper that uses some kind of a query template and escapes the values for you. Try Dibi for instance (http://dibiphp.com/)

petr.pavel 19 Junior Poster

Hi Zack, the bug will probably lie in a piece of code that you haven't pasted.

It appears that the first piece of code you pasted isn't related to the second in any way. It doesn't show how values end up in $_SESSION or $_SESSION.

Please attach a complete source code and I will have a look.

A suggestion: name your variables in a way that reflects the plurality or singularity of their content. For example, $itemName sounds like this variable holds only one item name. I wouldn't expect an array of item names. For this you should name the variable $itemNames. Little details like this (called naming convention) will help you avoid bugs like assigning an array to a variable that is meant to hold a string (which is probably the core of your current bug).

petr.pavel 19 Junior Poster

Hi Anirban, please send a link to what you have already programmed and describe what issues you're having.

petr.pavel 19 Junior Poster

Hi Jacob, the easiest way would be to use some mailing library like XPertMailer http://www.xpertmailer.com/. It would take care of all the boring stuff related to sending attachments or html e-mails or validating e-mail addresses, or even protecting yourself from e-mail injection attack.

If you however, insist on implementing it yourself, here's a good tutorial:
http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php
It's the #1 hit in Google when you search for "send attachment php".

Petr

petr.pavel 19 Junior Poster

Hi there,
since you don't have a control over the server there's nothing you can do to in order to make the default mail() function work.

To be really really sure create a file with just one line:

mail('your@address.com', 'this is a test', 'test body');

I have been sure so many times and yet I was proven wrong later. So it's best to make your tests as simple as possible.

If you get the test message when run on your dev box but not from the production server you should give this script to the hosting company and tell them to fix their setup.

If they tell you to screw yourself you'll have to work around it. Consider using some mail() replacement like the excellent XPertMailer:
http://xpertmailer.sourceforge.net/
You can switch it to use a direct SMTP connection instead of default mail() function. For that case you will need to know what's your hosting's SMTP server for outgoing connections. Or you will have to use some other SMTP server, likely with SMTP authentication turned on.

XPertMailer has one additional feature and that is to connect to SMTP server of the recipient domain. That way the e-mail is sent through different SMTP servers, no need to use your own SMTP server.

Petr

petr.pavel 19 Junior Poster

... I uploaded it and mysql displays it right. ...

You're being imprecise. What "mysql" displays it right? phpMyAdmin? or you're logged into MySQL using default command line client? If yes then what operating system you run the client on (Windows? Or do you connect to your server via ssh and there you run the command line client?) Your client or something along the way may translate the encoding so you have to provide exact information.

For instance, phpMyAdmin itself runs in some encoding (you can change that, you should be using UTF-8 - check in your browser). Then when you import using phpMyAdmin (you still didn't tell me what you use for importing) you tell phpMyAdmin what the source encoding is. The attribute you import to must also be in UTF-8 otherwise it would normally display rubbish but your browser might change its encoding based on content auto-detection without you even noticing it.

I hope you're not copy/pasting the sql into something that doesn't run in UTF-8...

petr.pavel 19 Junior Poster

1. I saved the following to a html file. I uploaded in the sever and with default encoding Greek, it was displayed correctly. I changed browser encoding to UTF8 and i got question marks.

That's understandable, only one of them will work. Just a question: is the text really in Greek language? I don't know what your nationality is so I don't know if you're saying Greek meaning "some rubbish characters" or if you're saying Greek because it really is and should be Greek alphabet. (No offence here, people call dummy fill-in text "Lorem ipsum" "Greek".)

If you want to work with UTF-8 you have to work with UTF-8 only - you can't have a part in iso-8859-7 (or what is it that you have) and part in UTF-8. There's no point in saving from notepad in anything else than UTF-8, all of your HTML pages must be saved in UTF-8 etc.

For testing if the SQL is in UTF you don't have to upload it to server. Just change the extension to .html, open the file locally in your browser, change browser encoding do UTF and see what you got.

A. To get the html code of all my pages, open it with notepad and encode it with utf8
B. To put the meta charset for utf8 to all of my pages. ( Have in mind that i did that for the pages that are used for the searching section, and also I did it with …

petr.pavel 19 Junior Poster

When I import to mysql i do it from a notepad file that i save it to *****.sql

Try saving it to .html, open it in Firefox/Explorer, select encoding the way stephen84s described and see if your source is all right.

Can you post here the script you use for importing? Maybe the problem is there.

Also, when you import, export it using phpMyAdmin and again, change the extension to .html, open in FF/MSIE, set encoding to verify that the import is ok.

petr.pavel 19 Junior Poster

anyone knows a way ?

Hi Punkis, my original comment still applies. You should focus on setting charset during import and setting charset in your application for regular usage.

petr.pavel 19 Junior Poster

Hi Punkis,
character encoding mismatch can be a nightmare.
The database, tables and attributes all have charset and collation. Make sure it's set to UTF8 and utf8_general_ci (or utf8_your_language_code).

Then you need to make sure that you select a character set both when importing into and when reading from the database. You "SET CHARACTER SET utf8" or "SET NAMES utf8" - NAMES will set collation to default for given character set which may or may not be good for you (not if you used utf8_your_language_code).

Also, sometimes you think the data you import is in UTF8 while in fact, it isn't which adds even more fun into the game :-)

You can be sure that mysql_select_db() certainly is somewhere in your application. It wouldn't work without it.

http://dev.mysql.com/doc/refman/5.0/en/charset.html
(This is for MySQL 5, look around for other versions if you're running a different version.)

petr.pavel 19 Junior Poster

Hi Welbzobeng,
have a look at the query. After SELECT and before FROM it lists what attributes it will fetch for you. files.* means "all attributes from table files so your artist should be covered.
You didn't say what attributes your db table "files" has so I can only assume that artist name is one of them. Let's assume it's called "artist".

You only showed us a part of show.tpl that displays table headings. Adding a new heading for Artist is easy, just insert this:

<td><a href="{$siteurl}/admin.php?view=admin_media&sort=artist"><b>Artist</b></a></td>

This piece of code also adds the link for sorting. I hope that somewhere in show.php you secure values in $sort because if not you're risking a SQL injection attack.

You didn't provide PHP code that assigns result of the query to your template (if you're using Smarty then it's something like $smarty->assign('variable', $values); ) and you didn't give us the part of your template that actually shows it. You will have to edit the template part and maybe the PHP part as well.
Post them here if you need more help.

Also I wouldn't be surprised if you had a separate db table for artists and "files" only used artist.id as a foreign key. Give us more details on your db tables if you need assistance here.

petr.pavel 19 Junior Poster

Hi Venom Rush,
please include a link to the project so that we don't have to search for it.
I would be surprised if they didn't have a usage example on their website.

petr.pavel 19 Junior Poster

Hi Namratashukla, I don't see a problem in updating a large number of records in database tables. You ask how - the answer is using UPDATE or INSERT statement.

I'm not sure if you're new to SQL (then google for "sql tutorial" or "sql reference") or if you didn't provide enough information. Why do you think that updating the db will be a problem? If you have many db tables then maybe your database design is bad and you should use less db tables (e.g. not one db table for each player).

petr.pavel 19 Junior Poster

Hi Asyieen,
I'm afraid the reason why nobody has answered so far is that it's not very clear what you actually want.

You posted a script that inserts records into projectcontact and user_upload.
And you say you want to display "these two elements". Word "element" is usually used for referencing a tag in a HTML document, while with databases we speak about tables, their records / rows and their attributes.

So what do you need? To list all records in a database table? Have a look at documentation for mysql_fetch_assoc() there's an example that does just that.

petr.pavel 19 Junior Poster

Helo Bear,
I guess the immediate problem is that you reference $checkbox instead of $_POST. You use $_POST so you probably work in an environment with register_globals off.

There is a few other things that I would like to draw your attention to:
* I guess you wanted to use count($checkbox) in your for statement, instead of $count which is a # of your db records. Not that it wouldn't work like you have it now but it makes more sense to use count($checkbox) when you in fact want to traverse $checkbox.

* remove id="checkbox[]" - id must be unique so you can't have it the same for all checkboxes. Also, you don't need it at all if you don't reference the items with JavaScript or CSS.

* it's better to name variables in a way that suggest what information they carry. E.g. $deleteCarsIds[] for an array that holds ids of cars that should be deleted. Variable name $checkbox doesn't suggest anything. Also if you named your variables well you would probably choose $carsDbCount and then it would probably hint to you that using $carsDbCount while traversing $deleteCarsIds isn't right.

* <meta http-equi... works only if it's placed into HEAD part of your document. If it works in your browser then you really cannot believe it will work in other browsers as well.

* either use <?php or <? but choose one and use it consistently

Good luck

petr.pavel 19 Junior Poster

I tried the style that you suggested and it added a single quote before the value.

Uhm, I find it difficult to believe that a CSS style could add an apostrophe.
Can you give me an URL with the HTML table you're trying to import? Or can you attach it here?
Petr

petr.pavel 19 Junior Poster

Hi there,
you're using function getParam() that isn't PHP built-in function.
So I guess you forgot to include a file that defines it.

petr.pavel 19 Junior Poster

I'm afraid you're not giving the full story here.
Is this script is embedded in a HTML document that has the Home title?
And you need to include (using require()) a part of this HTML document, right?
If my guesses are right then:

You cannot have two TITLE tags in one HTML document - there can only be one and it must be in HEAD (HEAD is at the very beginning of a HTML document). That's why you cannot use TITLE later on in the included file that comes into BODY part of the parent document.

The quick'n'dirty solution is to use JavaScript to change the title.

<script language="JavaScript">
document.title = 'new title';
</script>

This is just for the user though, search engines won't see it, they will still read the original value (Home).

petr.pavel 19 Junior Poster

No. PHP runs on a server while you want to drag and drop on a client (your browser). You will have to use AJAX, flash or Java applets for this kind of magic.
For that I suggest asking in different forums on this server.

petr.pavel 19 Junior Poster

Hi there,
you're treating $value as if it were an object while it is in fact a string "".
You cannot write $value->id unless you first assign an instance of an object to $value.

petr.pavel 19 Junior Poster

Hi Khanbaba,
the problem is not related to your stored procedure.
mysql_connect doesn't return an object but a resource pointer. Therefore you cannot use

$resource = mysql_connect(...);
$resource->prepare(...);

You have probably confused it with mysqli() set of functions:

$mysqli = new mysqli(...);
$stmt = $mysqli->prepare(...);

btw: if you want to display a value of $author_keyword you have to type echo $author_keyword; not just $author_keyword;

petr.pavel 19 Junior Poster

Hi Kwesiaryee,
I suggest you try a server like scriptlance.com or offer a bounty for this task. It's too much work to do for free.

My understanding is that people in this forum help with technical difficulties, single and isolated problems. People who need to know something ask questions here. What you need though, is a custom programming.

I could do this for you for 35 USD.

petr.pavel 19 Junior Poster

Hi there,
in HTML apply this

style="mso-number-format:'\@';"

to cells with your . values or define a CSS class with this style and apply the class.

petr.pavel 19 Junior Poster

Hi there,
I have read a few articles about WordPress plug-ins and themes but I can't figure out how to create a completely new page that uses theme.

Let's say that my blog is set up to display post detail with the following url:
http://myblog.com/2008/06/29/this-is-title

I want the comments listing and new comment form to appear on a separate page, say:
http://myblog.com/2008/06/29/this-is-title/comment

I know how to remove comments from the post detail page and replace it with a link to the comment page. But I don't know how to create a completely new page that would use my theme. I need this page to know the post slug/id but that should be possible given that the url contains it.

Could anyone please send me a link to an article that explains this?

Thanks
Petr

petr.pavel 19 Junior Poster

I'm sorry I assumed that you are running Windows on your development box and that would be why GD doesn't find the font in Windows font folder.

I'm quite sure that you don't have to configure GD library in any way so let's look for other reasons that imagettfbbox() fails.
Are you are absolute sure that monofont.ttf exists in the path you specified, user that runs the web server can read it? Try something along these lines:

if (!file_get_contents('/absolute/path/monofont.ttf')) die('cannot read');

If on Windows try double back slashes instead of forward slashes - or vice versa.
Where is monofont.ttf stored and what syntax did you use when trying the absolute path?

Try downloading the latest version of GD library for your operating system (what is your operating system, by the way?). Did you compile it or got a binary? If compiled then try to get a package with binary instead.

I found that people reported problems if the file name contained a hyphen. Doesn't seem to be your problem though. Could be somewhere in the path?

petr.pavel 19 Junior Poster

Either you forgot to attach the source code or you got the tenses wrong. Please re-read your posts in a preview before posting. They contain a lot of typing errors that further confuse the matter.

Did you mean you had already "postED" the source code? I wanted to see the code after you made the changes. I thought you said that it started to report invalid password after you made the change. So that's why I need to know how the code looks now.

petr.pavel 19 Junior Poster

What I mean with POSTemail is that my script stops after posting password

Yes, that's because of the exit() statement. Just remove it and the script will continue.

plus now instead of update succesful I get invalid passworsd even if is right

Maybe you removed the md5() function completely, I don't know. Can you post the whole script as an attachment?

petr.pavel 19 Junior Poster

Hi there,
I'm not sure I understand.

It sounds like you already have what you want. You said you want to display a file size in a browser after user selects the file to be uploaded. Why can't you use the jqUploader as it is without modifying the source code?

Or is it that you want the PHP script to know the size of the file you are uploading? And you think that the best method is to find out the file size with JavaScript and pass the information over to the PHP script?
Well, you'll be glad that PHP has its own function to find out a file size: filesize ( string filename ); Please provide more info.

petr.pavel 19 Junior Poster

Hi there,
the bug is in this if statement. Try using parentheses to make your intentions more clear:

if ( (!isset($filter)) && ($page == 1) )

Frankly I would just write this instead of the whole if/else if bunch:

if ($page == 1)
  imagegif($image, "user/" . $user . ".gif");
imagegif($image);

Also, you could make the initial testing a bit more simple:

$page = max(intval($_GET['page']), 1);

I guess you start paging with 1, which is a bit impractical.
If you start with zero you could do with a plain intval($_GET['page']);

petr.pavel 19 Junior Poster

Good news, it works now :-)
Tested in MSIE and Firefox. I do see the banner - when I switch off my Adblock, of course ;-)

I think it was either Google problem or something with your connection. The way you included the code is correct (I prefer using " to ' in tags but practically it doesn't matter).

petr.pavel 19 Junior Poster

Hi there,
sorry I can't help you but you won't solve this situation by having a discussion in a forum. What you really need is someone with CakePHP and ASP experience and you will have to pay him/her to do the job. Be prepared that it won't be trivial although I can't really say because you said nothing about the site being migrated.
If you have no experience with PHP and most especially with CakePHP then I'm afraid you can't do the job.

petr.pavel 19 Junior Poster

Hi Tanha, why do you think that using classes and objects will help you achieve what you want?
It's just a different programming method as compared to linear, or spaghetti :-) code.
If you insist on a class then simply take your code and wrap it as a class.

Also it sounds suspicious that you ask for a code for something that you already have.

I would say that the issue really is somewhere else. Either someone told you to use a class and you're not sure what that is - then a simple question in a discussion forum won't save you.
Or you want to reuse your code and you think that OOP is the only way.

I suggest that you place the code you want to reuse into a separate file and simply include it into every place where you need it:

include "myform.php";
petr.pavel 19 Junior Poster

Hi there,
I suspect that it fails because it looks for the font in a wrong directory.
You can either specify the path in the call of imagettfbbox

imagettfbbox($font_size, 0, 'c:/windows/fonts/monofont.ttf', $code)

or use environment variable to set the path for all calls.

putenv('gdfontpath=c:/windows/fonts/');

I'm not sure if it's GDFONTPATH or gdfontpath. For Windows use semicolons to separate multiple paths.

Good luck.

petr.pavel 19 Junior Poster

Hi there,
the main thing is that you start with applying md5() to the password so even when the password was empty you get something (this: d41d8cd98f00b204e9800998ecf8427e). The solution is to test not $Password (that contains the md5 sum) but $_POST.

I'm not sure about what you mean by "plus I don't get POST email" but, if password change is successful you run exit(). So that could be the thing.

petr.pavel 19 Junior Poster

Hi I also used to set up my own configuration until I got fed up with it and switched to XAMPP. Give it a try:
http://www.apachefriends.org/en/xampp.html

However, if you can't or don't want to then post here your httpd.conf so that we have something to start with. There can be dozens of things wrong.

petr.pavel 19 Junior Poster

Hi there, I have no experience with printing directly from PHP but here's what I found in PHP manual. I hope it helps.

$handle=printer_open("EPSON TM-T88III Receipt");
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_write($handle, $yourRawData);
printer_close($handle);