Search found 143 matches

by L33R
Mon Jul 06, 2015 1:58 am
Forum: PHP coding => General
Topic: what did i do wrong with the conditional statement ?
Replies: 0
Views: 726

Re: what did i do wrong with the conditional statement ?

http://php.net/Number_format

has a string for the first parameter:

<?php echo number_format("federal",2)?></p>
by L33R
Fri Jul 03, 2015 2:58 am
Forum: PHP coding => General
Topic: PHP Variable
Replies: 1
Views: 685

Re: PHP Variable

With the code you have supplied it couldn't of worked. Maybe the code was altered in March by mistake or some other process is handling the url parameters somehow.
by L33R
Fri Jul 03, 2015 2:56 am
Forum: PHP coding => General
Topic: how to learn book or website
Replies: 2
Views: 748

Re: how to learn book or website

http://www.homeandlearn.co.uk/php/php.html

http://www.killerphp.com/php-videos/


a simple google search will return hundreds of thousands of results.
by L33R
Fri Jul 03, 2015 12:51 am
Forum: PHP coding => General
Topic: how to learn book or website
Replies: 2
Views: 748

Re: how to learn book or website

Depends on what you already know. Youtube is usually a good place to start.
by L33R
Fri Jul 03, 2015 12:46 am
Forum: PHP coding => General
Topic: PHP Variable
Replies: 1
Views: 685

Re: PHP Variable

Code: Select all


$txtid=$_GET['txtid'];

by L33R
Fri Jul 03, 2015 12:42 am
Forum: mySQL & php coding
Topic: [ Help ] Getting Data From Mysql Query on PHP Function Using While
Replies: 0
Views: 633

Re: [ Help ] Getting Data From Mysql Query on PHP Function Using While

You need to return the query from the function:

Code: Select all

<?php

function showdata($id)
{
   $query = mysql_query(" select * from article where id='$id' ");
   return $query;

}

?>


by L33R
Mon Jun 29, 2015 4:15 am
Forum: PHP coding => General
Topic: Social Messaging System, Like Facebook
Replies: 0
Views: 520

Re: Social Messaging System, Like Facebook

Ho w about a cross reference table that holds :


cross refence table:

accounts.table.id = user id
message.table.id = message
message_access = boolean, if this is yes they can see it if its no they cannot.


just put a join and conditional statement in your query.
by L33R
Mon Jun 29, 2015 12:18 am
Forum: PHP coding => General
Topic: Simple php command fails
Replies: 0
Views: 419

Re: Simple php command fails

firstly you are missing the increment off in the for loop;

for ($i=0; $i <= 800 ; $i++)


secondly whenever your loop gets to 95 it resets back to 0 every time. thats why its crashing because its an eternal loop. it never reaches 800.
by L33R
Mon Jun 29, 2015 12:04 am
Forum: PHP coding => General
Topic: else if statement issue
Replies: 0
Views: 534

Re: else if statement issue

Hi, There is nothing wrong with your if statement. It returns no match found. 'sara' isnt the same as ' sara '; the latter has spaces at each end. $name='sara'; if ( $name == 'New York' ) { echo 'This is New York'; } elseif ($name == 'sara') { echo ' hi sara ' ; }else { echo 'No Match Found'; }
by L33R
Fri Jun 26, 2015 2:02 am
Forum: PHP coding => General
Topic: PHP + Windows 7 + AMPPS: [function.copy]: failed to open stream: No such file or directory
Replies: 0
Views: 547

Re: PHP + Windows 7 + AMPPS: [function.copy]: failed to open stream: No such file or directory

try using these functions : $upload_filename = $_FILES['file']['name']; is_uploaded_file($_FILES['file']['tmp_name']) or die("you were trying to do something naughty. "); move_uploaded_file($_FILES['file']['tmp_name'],$upload_filename) or die("we had a problem saving your image to {$upload_filename}...
by L33R
Wed Mar 11, 2015 4:32 pm
Forum: PHP coding => General
Topic: Help Needed Pls
Replies: 0
Views: 511

Re: Help Needed Pls

<?php session_start(); if(isset($_POST['submit'])) { $link = mysql_connect("localhost","root",""); $db = mysql_select_db('cms',$con); $email=$_POST['email']; $name=$_POST['name']; $subject=$_POST['subject']; $designation=$_POST['designation']; $num=$_POST['#']; Never seen this before //$add_type=$_...
by L33R
Wed Sep 10, 2014 3:14 am
Forum: PHP coding => General
Topic: Print new line
Replies: 1
Views: 814

Re: Print new line

swap the \n for <br /> tag

Code: Select all

$out = array();
exec('ls -l', $out);
foreach($out as $line) {
    echo $line . "<br />";
}
by L33R
Mon Apr 23, 2012 4:53 am
Forum: HTML Basics
Topic: integrating PHP with HTML page to execute SQL Query
Replies: 0
Views: 1827

Re: integrating PHP with HTML page to execute SQL Query

Ive had a quick look. I havent looked at every little part so heres what is wrong with what I have looked at. There may be more wrong with it: This while loop below...I guess that if there are 50 images you want to view them all? The while loop below just reads through all of the images and overwrit...
by L33R
Mon Apr 23, 2012 4:14 am
Forum: PHP coding => Images
Topic: creating thumbnails
Replies: 6
Views: 3063

Re: creating thumbnails

just set the width & height of the img . Then link to the page showing the image in its full size. <html> <head> <title>test</title> <body> <a href="image_view.html"><img src="images/50868449.jpg" width="100" height="100"></a> </body> </head> </html> on the other page : <html> <head> <title>test</ti...
by L33R
Mon Apr 23, 2012 3:58 am
Forum: PHP General
Topic: Advice for becoming a junior php developer?
Replies: 1
Views: 717

Re: Advice for becoming a junior php developer?

Get as much exposure as you can developing websites. PHP, HTML, CSS, JQUERY, Javascript . when you have a core knowledge of PHP you should start looking into the frameworks around..Wordpress, Joomla etc... Look into getting Zend Certified. Start applying for junior positions. Provide a list of sites...
by L33R
Mon Apr 23, 2012 3:49 am
Forum: PHP coding => Mail
Topic: PHP upload file error
Replies: 1
Views: 1116

Re: PHP upload file error

set your MAX_FILE_SIZE

<input type="hidden"name="MAX_FILE_SIZE" value=file size here />

also check phpinfo() for upload_max_filesize.
by L33R
Mon Apr 23, 2012 3:23 am
Forum: PHP General
Topic: How can it work?
Replies: 2
Views: 785

Re: How can it work?

I assume it works because you dont have to declare variables either .

$var = 12345;
echo $var;

so it works for the same reason the above code works.
by L33R
Mon Apr 23, 2012 3:02 am
Forum: PHP coding => General
Topic: Very basic issue with classes
Replies: 0
Views: 537

Re: Very basic issue with classes

when you are using the keyword $this you dont use the preceding $ of the attribute:

$this->a=1;

Code: Select all

class test {
protected $a;
public function __construct ()
{
    //$this->$a=1; <-- error here
    $this->a=1;  <--- will work
}
}
$obj = new test();
?>
by L33R
Tue Mar 06, 2012 8:35 pm
Forum: PHP coding => General
Topic: warning: number_format() expects parameter 1 to be double
Replies: 9
Views: 4812

Re: warning: number_format() expects parameter 1 to be doubl

Seems you were correct when you cast it into a double.
Seems pretty dodgy to me . Having to trust the data to be correct.

If I find anything else I will post it on here
by L33R
Tue Mar 06, 2012 7:09 am
Forum: Free time
Topic: just thought id ask...
Replies: 4
Views: 2013

Re: just thought id ask...

Yep, I know the feeling LOL.

Im hooked on that multiplayer though. I just cant put it down . I think Ive logged about 150 hours playing it. I wouldnt mind if I was any good but Im not! LOL. Ill never get that time back..
by L33R
Tue Mar 06, 2012 7:04 am
Forum: PHP coding => General
Topic: Passing Argument
Replies: 0
Views: 584

Re: Passing Argument

What is the error message you are getting?
by L33R
Mon Mar 05, 2012 9:34 pm
Forum: PHP coding => Mail
Topic: Pass all values of multi-checked checkboxes
Replies: 2
Views: 1815

Re: Pass all values of multi-checked checkboxes

try some thing like, simple two dimensional array. will keep all four values for each each question. <?php if (isset($_POST['question'])) { foreach ($_POST['question'] as $q) { foreach ($q as $f) { print_R($f); } } } ?> <html> <head></head> <body> <form method="POST" action=""> <input type="text" na...
by L33R
Mon Mar 05, 2012 6:49 pm
Forum: PHP coding => General
Topic: passing integer argument as 09!
Replies: 4
Views: 823

Re: passing integer argument as 09!

No probs. Glad I could help.
by L33R
Mon Mar 05, 2012 5:07 pm
Forum: Free time
Topic: just thought id ask...
Replies: 4
Views: 2013

Re: just thought id ask...

Think I was drunk when I wrote that . LOL :oops:

Must of been on Battlelog or xbox forums and decided to post that.

Top Game though, very addictive. Ive been playing far to much of it recently.
by L33R
Mon Mar 05, 2012 2:12 pm
Forum: PHP coding => General
Topic: passing integer argument as 09!
Replies: 4
Views: 823

Re: passing integer argument as 09!

Numbers prefixed with a zero in PHP are taken to be Octal. 00 - 07. 8 & 9 are treated as invalid and assigned 0. octal = base 8. just use a string if youre wanting to pass zero pre-fixed onto it. You cant hold a zero prefixed number as an integer. validate and pad it in your method. Something like: ...