wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
When using a variable which is an array within a string you should warp them with braces {} Also it is not recommended to place raw $_POST data into a query. You should atleast validate and escape/secure user input before using it within a query.
-
Problem with htacces in apache and windows server
wildteen88 replied to b2k's topic in Apache HTTP Server
Is that all the configuration? As it appears there must be more which the following error you posted suggests, unless it is an old error: [sun Feb 17 16:45:30 2008] [alert] [client xxxxxxxxx] W:/www/.htaccess: <Directory not allowed here In which case it should cause a 500 Internal server error rather than a 403 Forbidden error. -
You'll have to use javascript for this. Tutorial: http://www.shiningstar.net/articles/articles/javascript/confirmsubmit.asp
-
Problems with Installing
wildteen88 replied to Saint2054's topic in PHP Installation and Configuration
What is the script you are trying to run? Make sure you are not using shorthand tags (<? ?> or <?= ?>) for your PHP scripts. If your script is quite large then enable a setting called short_open_tag within the php.ini Your Apache configuration appears to be fine. -
Login Problems.. and no error? Please help :)
wildteen88 replied to jadedknight's topic in PHP Coding Help
Do you have error_reporting set to E_ALL and is display_errors enabled? Also are you using the CodeIgnitor framework? -
simpley add $id = $_GET['id']; in between the parenthesis for Lumios code, eg: if (isset($_GET['id'] && is_numeric($_GET['id'])) { $id = $_GET['id']; } else { die('Invalid id'); // display error if id is not numeric; }
-
Problem with htacces in apache and windows server
wildteen88 replied to b2k's topic in Apache HTTP Server
Check Apaches error log for why. What configuration is contained within the .htaccess file? -
Try: SELECT ( IFNULL( displayname, CONCAT_WS( ' ', firstname, lastname )) ) AS display_name FROM users Seems to do the trick. Not bad for a quick test and first try.
-
Just subtract their brith year from the current year, eg: $dob = '28-08-92'; $birthYear = date('Y', strtotime($dob)); $curYear = date("Y"); $age = $curYear - $birthYear; echo 'Your age is: ' . $age . ' years old';
-
Could you explain what are you wanting to do with the code? Get the persons age?
-
You made sure Apache is running before going to http://localhost? What happens if you go to http://localhost instead.
-
In the following few lines: // initialise errors array // $errors = array(); // check for empty fields use javascript to // if(empty($email) || empty($password)) { $errors = "<br /><div class=\"formerror2\"><img src=\"images/cross.gif\"> <b>You never filled in both login fields.</b></div>"; } You initiate the $error variable as an array. Then a few lines down you are reseting the $error variable as a string which is why you are getting the error message. You should add [] after $error to add the string to an array. So use the following instead: $errors[] = "<br /><div class=\"formerror2\"><img src=\"images/cross.gif\"> <b>You never filled in both login fields.</b></div>";
-
Quick apache problem (no one is in the apache forum)
wildteen88 replied to alphadeltaviii's topic in PHP Coding Help
Thread locked. Do not double post. -
In order for strtotime to return a unix timestamp it requires a valid english readable date, eg: 2/16/2008 23:00 not 2 16 2008 11 PM You might want to look into mktime rather than strtotime. Also no need to use date either to convert the value strtotime returns as it already returns a unixtime stamp. Another thing which is not required (and irritates me - no offense) is ending lines with empty strings after/before using a variable (."");
-
If you are getting strange characters like:  outputted and their not within your PHP code then make sure you are saving your .php files as ANSI encoding and not UTF-8. I have had this issue before awhile back and it was to do with file encoding when saving.
-
Yes. However you'll have to code the function yourself, there is not a builtin function for this. You'll want to read up on opendir and readdir functions.
-
The problem is you're using both mysqli_* and mysql_* functions. You cannot use both function types together they are incompatible. You'll have to convert all mysqli_* functions to the old mysql_* functions if you dont want to use mysqli based functions. However mysqli_* functions are compatible with MySQL4.1.3 or above according to php.net. Your mysql queries are most probably the issue and not the code.
-
This is a known issue. We have recently upgraded the forums and it hasn't been added back yet. However this is not a high priority issue currently due to our forums being hacked recently. I'm assuming your using a form and submitting the data via POST to each page. In which case your can just use a hidden form field to transfer the RecordID from page to page.
-
Upon opening the attached file It had some strange É type characters in place of where spaces should be. Doing a simple find and replace within my PHP editor to convert these chars to spaces allowed the script to function correctly.
-
A better way would be to set the ServerAlias direcitive to www.subdomain.domain.com within the virtualhost for subdomain.domain.com <VirtualHost *:80> DocumentRoot /path/here/ ServerName subdomain.domain.com ServerAlias www.subdomain.domain.com </VirtualHost>
-
Change your code to: mysql_query("insert into test values (' ', '$day', '$date', '$location', '$time', '$division', '$team1',' ','$team2,' ','$comments') or die('Query error: ' . mysql_error()); echo 'Success';
-
Your code will output xxx because you are not saving the changes back to the original string. You seem to be confused with how foreach works. str_replace can take an array of replacement words to be replaced by a single string, Your code can be simplified to just: $words = array("mum","dad","sister","brother"); $string="i got a sister"; echo str_replace($words, 'xxx', $string); // result: i got a xxx