Search found 40 matches

by Jeroen
Tue Oct 09, 2012 7:28 pm
Forum: PHP General
Topic: Best IT training institute
Replies: 0
Views: 679

Re: Best IT training institute

Try php.net
by Jeroen
Tue Oct 09, 2012 7:28 pm
Forum: PHP General
Topic: Will mysql_connect itself?
Replies: 2
Views: 1127

Re: Will mysql_connect itself?

No, it wont, if you call mysql_connect 3times, it connects 3times.
by Jeroen
Tue Oct 09, 2012 7:27 pm
Forum: PHP coding => General
Topic: server alert
Replies: 0
Views: 529

Re: server alert

You can use crontabs for that.
by Jeroen
Tue Sep 11, 2012 7:44 am
Forum: PHP coding => General
Topic: Warning: mysql_fetch_array() expects parameter 1 to be resou
Replies: 7
Views: 1020

Re: Warning: mysql_fetch_array() expects parameter 1 to be r

willy134uk wrote:hi thanks ive done that but now i get the same error on line 16
What error do you get from mysql_error as in my first example? That should give you your awnser
by Jeroen
Tue Sep 11, 2012 7:43 am
Forum: PHP coding => General
Topic: Passing variables from controller to view
Replies: 1
Views: 768

Re: Passing variables from controller to view

You set the variable AFTER you do the output public function addresses($arg = false) { echo'Addresses '.$arg.'<br />'; //Why output in your controller? $this->view->showAddresses = $this->model->getAddresses(); //Where is this method in your code? And you better create a method to set "showAddress" ...
by Jeroen
Tue Sep 11, 2012 7:36 am
Forum: PHP coding => General
Topic: rename()
Replies: 1
Views: 1196

Re: rename()

No rename does not delete a folder or file. If the folder name you want to rename it to exists, or the tree does not exists, you get an error and nothing happens.
by Jeroen
Tue Sep 11, 2012 7:34 am
Forum: PHP coding => General
Topic: Lost content after submit form
Replies: 0
Views: 645

Re: Lost content after submit form

It is a big guess, as there is no actual code posted that can cause your problem. But this is my guess: You need to sanitize your data before putting it in your database: if(isset($_POST["submit"])) { $txtName = mysql_real_escape_string($_REQUEST['txtName']); //or (not so save) $txtEmail = htmlspeci...
by Jeroen
Tue Sep 11, 2012 7:29 am
Forum: PHP coding => General
Topic: Warning: mysql_fetch_array() expects parameter 1 to be resou
Replies: 7
Views: 1020

Re: Warning: mysql_fetch_array() expects parameter 1 to be r

Change this: $sql=mysql_query("select releases.*, groups.name as group_name, groups.description as group_description from releases JOIN groups ON releases.groupID=groups.ID where visit = 0 limit 0,1 ")or die(mysql_error()); And you know what is wrong. Probably you need to change it to: $sql=mysql_qu...
by Jeroen
Mon Sep 10, 2012 9:14 am
Forum: PHP coding => General
Topic: RSS Feed Code with htmlentities
Replies: 0
Views: 351

Re: RSS Feed Code with htmlentities

You need to make sure to use the same charset as the feed on you website, or convert the charset to the charset you are using.

Code: Select all

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

Code: Select all

 utf8_decode( $texttodisplay);
by Jeroen
Mon Sep 10, 2012 9:12 am
Forum: PHP coding => General
Topic: Activation only after toggled
Replies: 1
Views: 352

Re: Activation only after toggled

Can you post some of your code? You description is too vague to understand your exact question.
by Jeroen
Mon Sep 10, 2012 9:01 am
Forum: PHP coding => General
Topic: select query
Replies: 2
Views: 707

Re: select query

It is better practice to use

Code: Select all

SELECT `this`,`alsothis` FROM `here`
to keep the memory use lower. With `*` you select ALL rows, also the ones you dont need.
by Jeroen
Mon Sep 10, 2012 8:59 am
Forum: PHP coding => General
Topic: How to open Php file?
Replies: 1
Views: 685

Re: How to open Php file?

You can use notepad to open PHP files.
by Jeroen
Wed Sep 05, 2012 11:29 am
Forum: PHP coding => General
Topic: php code no longer works in php5
Replies: 0
Views: 573

Re: php code no longer works in php5

Do you get any errors? You can enable them, or look into the logfiles.
It is much easier to help you with a nice error.
by Jeroen
Sun Sep 02, 2012 8:27 pm
Forum: PHP coding => General
Topic: Trying to understand...
Replies: 0
Views: 331

Re: Trying to understand...

This is not PHP, it is javascript.

What is wrong with your script, what does not validate, what errors do you get?

This javascript uses a framework, similar to jQuery (I dont know what framework), but they use _ as a shorthand, as jQuery uses $.
by Jeroen
Sun Sep 02, 2012 8:21 pm
Forum: PHP coding => General
Topic: PHP/jQuery Validation
Replies: 3
Views: 448

Re: PHP/jQuery Validation

Thanks for reply. With the above code that you provided i'm getting this message: Parse error: syntax error, unexpected T_IF in /Users/Tim/Sites/2012MP/check_email.php on line 7 Im still concerned about whether or not the remote jquery validation works with localhost aswell? I forgot a ";", I edite...
by Jeroen
Sat Sep 01, 2012 1:15 pm
Forum: PHP coding => General
Topic: PHP/jQuery Validation
Replies: 3
Views: 448

Re: PHP/jQuery Validation

<?php include 'database.php'; ?> <?php $email = mysql_real_escape_string( $_REQUEST["email"]); $checkemail = mysql_query("SELECT COUNT(id) as `num` FROM `users` WHERE `email` = '".$email."'"); $count = mysql_fetch_assoc( $checkemail); if ( (int)$count['count'] === 0){ echo "false"; } else { echo "t...
by Jeroen
Sat Aug 18, 2012 8:03 am
Forum: PHP coding => General
Topic: Includes within master includes
Replies: 2
Views: 784

Re: Includes within master includes

You can use .htaccess (apache) to get nice urls. Here a simple example to direct anything to index.php: RewriteEngine On RewriteRule !.(js|css|ico|gif|jpg|png|eot|evg|ttf|woff|php|txt|xml|html)$ index.php RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{R...
by Jeroen
Sat Aug 18, 2012 7:58 am
Forum: PHP coding => General
Topic: Question about classes
Replies: 2
Views: 443

Re: Question about classes

You can use __autoload to automaticly include files.

Otherwise you need to just include the files in your code.
by Jeroen
Wed Aug 15, 2012 9:10 am
Forum: PHP Scripts
Topic: Help php where insertinto
Replies: 2
Views: 1171

Re: Help php where insertinto

You don't set $code in your code, and WHERE does not work with an insert. <?php echo "Refer to list of Profession ID's and enter details accordingly"; mysql_connect ("localhost", "root", "") or die ('Error: ' . mysql_error()); mysql_select_db ("office_db"); $name = mysql_real_escape_string( $_POST['...
by Jeroen
Wed Aug 15, 2012 8:59 am
Forum: PHP coding => General
Topic: ftp_nlist(): supplied resource is not a valid
Replies: 0
Views: 327

Re: ftp_nlist(): supplied resource is not a valid

in windows, ftp_nlist will die on a directory with a space in it's name. to get around this, use ftp_chdir
by Jeroen
Wed Aug 15, 2012 8:57 am
Forum: PHP General
Topic: php as a code behind ?
Replies: 0
Views: 628

Re: php as a code behind ?

by Jeroen
Wed Aug 15, 2012 8:52 am
Forum: PHP coding => General
Topic: help
Replies: 0
Views: 323

Re: help

by Jeroen
Mon Aug 13, 2012 4:40 pm
Forum: PHP Scripts
Topic: What is the replacement of dl() in php-5.3 onwards?
Replies: 1
Views: 792

Re: What is the replacement of dl() in php-5.3 onwards?

You can enable dl in your php.ini file: enable_dl = on
But i advice to just enable the extension, instead of loading it dynamically.