Forum: PHP Feb 12th, 2009 |
| Replies: 6 Views: 422 Hm,
Appears you are right.
It really does not replace new line indicator by html equivalent <br /> it only inserts it before the new line indicator. Odd....
So instead using nl2br, you can use... |
Forum: PHP Feb 12th, 2009 |
| Replies: 6 Views: 422 Nav33n's proposal will return a string with no spaces, instead with new lines where the breaks are.
In order to return a string with line breaks, you should replace <br /> with \n , store it in a... |
Forum: PHP Dec 1st, 2008 |
| Replies: 7 Views: 832 It is up to you. If you start building a large website with a lot of repeating code like headers, navigation menus, etc, you will realize how helpful the includes are.
Later on, you will realize... |
Forum: PHP Dec 1st, 2008 |
| Replies: 5 Views: 589 Hm, I think that the question was whether multiple visits on a database-driven site would be handled well, because each php page, which requires data from the db, would initiate a new sql session as... |
Forum: PHP Nov 29th, 2008 |
| Replies: 2 Views: 482 You can't.
SHA is one-way encoding mechanism. So in order to verify a password, the verification string has to be encoded using the same key as it has been initially encoded upon inserting into the... |
Forum: PHP Nov 28th, 2008 |
| Replies: 3 Views: 412 Ok, the error says that no result has been returned from sql. This may be caused either by no data in tables or by a wrong sql statement.
I suggest you to put this line just after... |
Forum: PHP Nov 28th, 2008 |
| Replies: 2 Views: 903 Depends on what you expect to happen next. You can act both in PHP, manipulating the returned array result, or you can change your SQL so that sql returns the first and last name as one column,... |
Forum: PHP Nov 27th, 2008 |
| Replies: 2 Views: 457 FTP_PUT () overrites files without warning. I have no idea about ftp_fput(), but I suppose it will overwrite as well, that is - it will replace content.
Why don't you try with a simple txt file... |
Forum: PHP Nov 26th, 2008 |
| Replies: 1 Views: 322 You are trying to create a JPG from PNG. I don't think that GD allows this. Therefore you should use createimagefrompng() and imagecopyresampled(). Also, header(content....) should be PNG, not JPG. |
Forum: PHP Nov 25th, 2008 |
| Replies: 8 Views: 1,816 Well, honestly, I do not like while loops, so I would go with scandir() function in php that returns an array of all files. Then I will manipulate the array and upload file by file, rather than... |
Forum: PHP Nov 24th, 2008 |
| Replies: 8 Views: 1,816 Hmmm.. I have had problem with file creation using php, so I had to change folder permissions to 777 and just then it worked.
I think also that you do not change the ftp_delete command, as it is... |
Forum: PHP Nov 24th, 2008 |
| Replies: 4 Views: 577 Ok, "effective" what do you mean by that?
If you mean effective - like having a lot of things that change, rotate, move from one place to another, have sounds and stuff, you should do it with... |
Forum: PHP Nov 24th, 2008 |
| Replies: 6 Views: 663 No, this is not a javascript question. Do some search on google for GET and POST method.
Also, if you really want to learn programming, go to http://www.w3schools.com/ |
Forum: PHP Nov 24th, 2008 |
| Replies: 8 Views: 1,816 Check permissions for read/write/delete on the folder on the remote machine using the name / pass. |
Forum: PHP Nov 24th, 2008 |
| Replies: 3 Views: 664 Why don't you create an activate service page. E.g. imagine not all users want to participate in the arcade, but by mistake they click on the game page....
I think it would be better you create a... |
Forum: PHP Nov 21st, 2008 |
| Replies: 3 Views: 561 Well, here you should do some coding before printing the contents:...
//this is where you need to intervene
if ($arr_getf = mysql_fetch_array($sth_getf)) {
print '....'
instead, do... |
Forum: PHP Nov 21st, 2008 |
| Replies: 2 Views: 1,729 OK, as far as I understand you first want to check if such an appointment already exists, then, if the date-hour is free, you want to write the appointment. Is that correct? If it is this way, you... |
Forum: PHP Nov 21st, 2008 |
| Replies: 6 Views: 3,003 I think there is no a 100% guaranteed solution for this problem, no matter you conform to standards or not. I use gmail and constantly i have mails from friends of mine going into the junk folder,... |
Forum: PHP Nov 21st, 2008 |
| Replies: 4 Views: 865 The proposed code works 100%, but maybe you have not explained precisely what do you want to do, or what errors you have, etc.
What pritaeas proposed is a 100% working solution to what you have... |
Forum: PHP Nov 21st, 2008 |
| Replies: 7 Views: 1,370 This is really strange, because I have tested the code in my server and it works perfectly. Note that it works either with or without the second dot with no problems. Basically what I did was to use... |
Forum: PHP Nov 20th, 2008 |
| Replies: 9 Views: 1,460 Guys, I am actually interested in the single quotes used - i mean one time quotes used are like this [ ‘ ] or [ ’ ], the other time used they are as supposed to be [ ' ].
I am not sure whether PHP... |
Forum: PHP Nov 20th, 2008 |
| Replies: 10 Views: 1,628 Ooops...my bad. I thought you want to append content rather than replace it.
In this case 'w' is correct option for fopen to be used. Maybe w+, but in any way, as I have read your code more... |
Forum: PHP Nov 20th, 2008 |
| Replies: 10 Views: 1,628 You should use fopen with parameter 'a' or 'a+'instead of 'w' in this way if file exists new data will be appended, otherwise php will attemt to create it.
... |
Forum: PHP Nov 20th, 2008 |
| Replies: 7 Views: 1,370 Hmm...
I analyzed your original script. So i think if we change the SELECT string like this, it will work for you.
$select = 'SELECT banned.ip FROM banned WHERE instr("'.$current_ip.'",ip)';... |
Forum: PHP Nov 20th, 2008 |
| Replies: 19 Views: 1,678 Sorry, my bad - use % instead of / for division of total numbers against display numbers. I don't know exactly in English how this division is called, but the result is integer with remaining result... |
Forum: PHP Nov 19th, 2008 |
| Replies: 19 Views: 1,678 Yes, it is ok like that... Keep on |
Forum: PHP Nov 19th, 2008 |
| Replies: 19 Views: 1,678 Yes, you are correct.
One suggestion only
this code
IF ( ISSET($_GET[combo_2]) )
{
$combo_2 = $_GET['combo_2'];
IF ( $combo_2 <> 0 ) // check to see if user has selected something... |
Forum: PHP Nov 19th, 2008 |
| Replies: 19 Views: 1,678 Well, is it viable - 100%, because otherwise your SQL select will be different and you will present different results when you click on a page number.
What concerns the checkboxes - I did not get... |
Forum: PHP Nov 19th, 2008 |
| Replies: 19 Views: 1,678 Well,
we have to start it all over again obvioursly :)
The things go like this.
In order to retrieve results from a search query, you have to do the following
1. Check what get or post... |
Forum: PHP Nov 19th, 2008 |
| Replies: 3 Views: 365 You have omitted column ( : ) on case 11, and the break statement after it. |
Forum: PHP Nov 19th, 2008 |
| Replies: 19 Views: 1,678 Yes, by usign get i refer to defining your search form as mehtod=get.
This is how normally get works. You can see the get request as all the symbols in the browser address which appear like this... |
Forum: PHP Nov 19th, 2008 |
| Replies: 19 Views: 1,678 Marcmm,
Normally the sql statement should be re-run every time with the new parameters. This is why it is good to use $_GET, instead of $_POST, because $_GET does not explicitly require a form... |
Forum: PHP Nov 18th, 2008 |
| Replies: 13 Views: 2,894 OK, what I mean is the following
$new_text is the variable name by which you refer to it in your code. The variable value is the value of $_GET['whatever'].
My question is - your string
... |
Forum: PHP Nov 18th, 2008 |
| Replies: 13 Views: 2,894 No, you did not mention the ZEND.
However, this insert as you have typed it contains the variable names instead of variable values. Is this the php code or the result from the php echo command?
... |
Forum: PHP Nov 18th, 2008 |
| Replies: 1 Views: 413 Your select can always be ' select * from whatever'.
Then you just retrieve an associative array using mysql_fetch_assoc, and then run a foreach loop like this
foreach( $result as $key =>... |
Forum: PHP Nov 18th, 2008 |
| Replies: 13 Views: 2,894 I suggest you do the following :
echo $sql;
Then simply copy the string from your browser and paste it into phpmyadmin sql statement and run it.
If it shouts an error, and it is still the... |
Forum: PHP Nov 18th, 2008 |
| Replies: 7 Views: 1,370 Well, actually if you use a database there is much faster way to do your job.
Your code should look something like this. Let's presume your db table is called 'banned' and your column with banned... |
Forum: PHP Nov 18th, 2008 |
| Replies: 3 Views: 1,125 Well...unfortunately I have never experimented with PDF creation in php. I suppose the php_end_page function is what you need.
I cannot help on this matter, sorry! |
Forum: PHP Nov 18th, 2008 |
| Replies: 3 Views: 1,125 First, please clarify what is your task exactly. Are you going to output code as HTML or PDF?
If you are going to output code as HTML, you better do the following.
Create a css file and include... |
Forum: PHP Nov 18th, 2008 |
| Replies: 2 Views: 679 Hmm...really strange. Normally LIMIT does not require brackets around the parameters, so LIMIT 0,5 should work for you.
I suggest you to run your sql query in an mysql graphical tool first and then... |