It is also stated in the forum rules as well :)

albanclesh commented: sorry! i didn't read the forum rules before +0

This line:

$txtname = "'. ucwords(strtolower($row ['First.Name'])) . '-'. ucwords(strtolower($row ['Last.Name'])) . "; 

should be:

$txtname = ucwords(strtolower($row['First.Name'])) . '-' . ucwords(strtolower($row['Last.Name']));

Or include the file that has the function :)

Should this line:

$this->stmt =execute(array('$this->getName()','$this->getNO()','$this->clocation()'));

Be:

$this->stmt =execute(array($this->getName(),$this->getNO(),$this->clocation()));

@Pritaeas,

You are a legend.

I carried on testing and resolved the issue with the __construct:

The class:

include 'crud.php';

class navigation {

    public function __construct($username, $password, $tableConfig) {
        $this->username = $username;
        $this->password = $password;
        $this->tableConfig = $tableConfig;
    }

    public function nav($table, $live, $loc) {
        /**
         * nav returns multiple records from the specified table with conditions
         * @param string $table Table name
         * @param array $live Set in DB condition to show page 1 = Live, 0 = Not Live
         * @return array $loc Set in DB shows location of page in Nav 1 = Top, 0 = Side
         */

        $dsn = new crud($this->username, $this->password, $this->tableConfig);
        $nav = $dsn->getRecords($table, array('live' => $live, 'loc' => $loc));
        $result = count($nav);
        $cnt = 0;
        $navKey = '<nav><ul>';
        while ($cnt < $result) {
            foreach ($nav[$cnt] AS $key => $value) {
                if (is_numeric($key)) {
                    unset($key, $value);
                } else {

                    if ($key != 'id' && $key != 'content' && $key != 'live' && $key != 'keywords' && $key != 'metaDesc') {
                        if ($key == 'title') {
                            $navKey .= '<li><a href="#">' . $value . '</a></li>';
                        }
                    }
                    unset($key, $value);
                }
            }
            $cnt++;
        }
        // Facebook include and G+1 code -> see main code page -> put into sep include files for ease of modification
        $navKey .= '</ul></nav>';
        unset($dsn);

        return $navKey;
    }
}

And the call:

$navigat = new navigation('XXXXXXXXuser', 'XXXXXXXXXX', $tableConfig);

$top = $navigat->nav('content', 1, 1);

print_r($top);

To be honest there are a lot of books out there, although there are also a lot of very helpful tutorials.

It sounds like a cop out but this goolge search:

https://www.google.co.uk/search?client=ubuntu&channel=fs&q=php+oop+for+beginners&ie=utf-8&oe=utf-8&gl=uk&redir_esc=&ei=g9aYUejdOImAOP-dgYAO

Has a lot they you may find very helpful and easy to follow.

As you are starting out, i would shy away from MySQL completely unless you decide to use a PDO wrapper.

If you do get stuck then by almeans drop a thread. The DaniWeb community is second to none when it comes to help and assistance.

Good luck, and happy coding.

try '$current'

@yy886,

This is part of an upload script i put together and using well:

$mime = array('image/gif', 'image/jpeg', 'image/jpg', 'image/png');
    if (in_array($_FILES['file']['type'], $mime) == FALSE) {
        echo "You are attempting to upload a \"{$_FILES['file']['type']}\" file type. <br/>
            This is not permitted.<br/>";
    } else {

$mime is an array that holds the accepted file types, the $_FILE[]['type'] is then checked to see if the uploaded mime type is allowed. If it is not, it is blocked.

Very similar to pixelsoul's example.

Have you got your mime types correct?

Have you checked your error log?

I would suggest adding a try{} and catch{}, as you may have an exception, or low value warning that is not showing up due to your settings

EDIT pipped by IIM :):)

OH DO I FEEL SHEEPISH

Sorted, many thanks fo ryour input Dani:

print $arr[0]['email'];

@LastMitch,

I am validating the mime type before progressing to the resizing OOP Class.

You are correct in the code you supplied, this is in the class functionalilty. I had created a multi array instead of one that i can validate the ['type'] from $_FILES.

So i cahnged the first line to:

$var = array('mimetype1','mimetype2');

And this parsed.

Thank you for your assistance and input. It is greatly received.

post your code

php.net

I googled and googled to try and find a comprehensive wiki/tut on how to share htdocs across a dual platform.

My base install is Windows 7 64bit, and recently (6wks ago) set up a dual boot.
One thing pained me for a while of not being able to use the current edited files from one system to the other.

So for anyone that is looking to do this, I finally sussed it and have it working :).

Assumptions:

  1. You have XAMPP installed on Windws platform
  2. You have XAMPP installed on Linux platform
  3. You know how to access Terminal in Linux

All text ->

Like this is in terminal

So, first things first we need to modify the way Linux mounts the additional drives/partitions.

Firstly unmount the Windows drive.

This is done using the fstab file. So before we make changes make a back up.

sudo cp /etc/fstab /etc/fstab_orig

We also need to get the UUID of our other drive (Windows drive) using blkid:

sudo blkid
/dev/sda1: LABEL="SYSTEM" UUID="9EC0347FC0346027" TYPE="ntfs" 
/dev/sda2: LABEL="OS" UUID="E868357B68354998" TYPE="ntfs" 
/dev/sdb1: UUID="4659932c-47e6-431b-8bda-779a3e2efb18" TYPE="ext4" 
/dev/sdb5: UUID="8170f6c2-aa22-4b9b-9480-8231665ff232" TYPE="swap" 
/dev/sdb6: UUID="783cc8a0-24c3-44cd-9c61-01d51d047099" TYPE="ext4" 
/dev/sdb7: UUID="26a38c59-f39c-47eb-b9aa-b15f4355951f" TYPE="ext4" 
/dev/sr0: LABEL="Disk1" TYPE="udf" 
/dev/sdc1: LABEL="WebDesign" UUID="18C47AFBC47ADB08" TYPE="ntfs" 

This will give you output of the UUIDs in use matching the HDDs. Make a note of the long alphanumeric UUID that corresponds to your Windows drive. Then using the editor of your choice (Iam using gedit in this), we are going to tag a line on the very end

sudo ...
LastMitch commented: Nice Work! +11
cereal commented: thanks for sharing! +11
diafol commented: Nice to know +14
pritaeas commented: Nice one. +14

No probs fellow, we all start somewhere.

With videos/pictures i personnally wouldnt store the vid in the SQL table (some do, some dont).

I would store the name, and link to the video only. This reduces the call time and also the size of your table.

This is just the SQL code for the table.

You need to add an additional column for example bday DATE NOT NULL,

Change bday to what you want it to be called

@LastMitch,

Thats the link i couldnt find :)

+1

@kakalahori

You need to install the PHPUnit module. This can be easily done via PEAR

http://pear.php.net/manual/en/installation.getting.php

Or via GIT

https://github.com/sebastianbergmann/phpunit/

I used PEAR in my set up as it also allows access to the pre compiled libraries.

ZF2 is no longer using zf.bat.

If you look over the base tutorial it takes you through how to install:

cd /my-project/dir
git clone git://github.com/zendframework/ZendSkeletonApplication.git
cd ZendSkeletonApplication
php composer.phar self-update
php composer.phar install

This obviously assumes you have composer, and git installed.

Here is a sample tut: http://bigemployee.com/zend-framework-2-simple-web-application-crud-using-ajax-tutorial/ that the above was taken from.

I am looking through ZF2 at the present (and also ZF1), do be careful on the ZF2 tut on the ZF2 website, as there are errors.

I have just gone through this a few times and installed onto Win 7 64Bit within 5 minutes.

Make sure you allow git to amend your PATH, and also ensure you manually add the composer PATH variable

Ok, i feel stupid.

I had:

protected function __initDoctype()
    {
        $this->bootstrap('view');

SHould be:

protected function _initDoctype()
    {
        $this->bootstrap('view');

Note the single _.

@LastMitch,

The link you put unfortunatley is relating to ZF2, i havent ventured on to that as yet.

But thank you for your input. I have seen HELPERS in ZF1 but not got to those, as i am going through a few tutorials and piecing bits together.

LastMitch commented: Nice Catch! +11

DO NOT USE THE MYSQL extension.

Although a lot of tuts will still use this, it has been superceeded by MySQLi.

You could also opt for, and one i use, PDO.

MySQLi basic connection:

$mysqli = new mysqli("localhost", "your_user", "your_password", "your_database");
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
else {
..do something wonderful..
}

PDO & MySQL connection:

try 
{
    $dbh = new PDO('mysql:host=localhost;dbname=DATABASE_NAME', 'your_user', 'your_password');
} 
catch (PDOException $e) 
{
    print "Error!: " . $e->getMessage() . "<br/>";
    die();
}

I agree. People are not going to review 1000 lines. Post the code you pinned as the problem

Have you tried just the php snippet:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

$script_url=$_SERVER['PHP_SELF']; //Change this if you want to use this as an include file.
$files_path="./album/"; // Where does the album start? Anything under the directory the script will read. With Trailing slash
$full_server="http://localhost:8080/phAlbum/album"; //Enter the full server path to where the albums start. //With Trailing Slash

I would say it is the same question as LastMitch has pointed out.

Anyway:

$script_url=$_SERVER['PHP_SELF']; //Change this if you want to use this as an include file.

This will telll you all about $_SERVER : http://php.net/manual/en/reserved.variables.server.php

$files_path="./album/"; // Where does the album start? Anything under the directory the script will read. With Trailing slash

As the comment on the script states: - This is where the gallery starts from

$full_server="http://localhost:8080/phAlbum/album"; //Enter the full server path to where the albums start. //With Trailing Slash

This is the test bed:

localhost = Local test URL (XAMPP etc)
phAlbum = The folder under htdocs where the script has been put
album = folder under /htdocs/phAlbum/ (see album path)

Looking at the README.TXT:

INSTALL INSTRUCTIONS

  1. Create an empty directory
  2. Set permissions on directory to 777
  3. Place 'gallery.php' in the directory
  4. Navigate to http://www.yoursite.com/yourdir/gallery.php
  5. The default password is 'admin' (Please change this by opening 'gallery.php' and changing the value of $password)

You need to create the folder album and chmod.

LastMitch commented: Nice Explanation! +10

From my understanding this is not going to work :

if(isset($_POST['emri'])){ $emri=$_POST['emri']}
 if(isset($_POST['mbiemri'])){ $emri=$_POST['mbiemri']}
 if(isset($_POST['email'])){ $emri=$_POST['email']}
 if(isset($_POST['nr'])){ $emri=$_POST['nr']}
 if(isset($_POST['adresa'])){ $emri=$_POST['adresa']}
 if(isset($_POST['shenime'])){ $emri=$_POST['shenime']}
 ) 

Your SQL is stating that "these fields" & "these values" you cannot use the if(isset... in this manner.

Try a dynamic SQL statement using:

$_POST as $field => $value

This takes the POST data and puts it into arrays, you would then step through them within you SQL stmt. So field and values are:

INSERT INTO kontakte ('$field[]') values ('$value[]');

*Note tested - this is an idea which you need to adapt

That way it will only use the POST fields that are isset.

*Side note - you should validate and clean any POST data

www.google.com

@LastMitch,

Think line 7 is wrong way round

echo "<img src='IMAGE/ITEMS/$image_folder_name/{$img['file']}' /><br>\n";
LastMitch commented: You are right. My bad. +7

Macromedia has no email ability.

Your test server (XAMP etc) will have this function. You will need to configure it

which one?

Each one.

lets take this on for example:

function check($arr,$name)
{
$found = false;
$c=0;
while(isset($arr[$c])&&!$found)
{
$found = $arr[$c]['item_name'] == $name;
$c++;
}
echo "Check: ".$found.", search for: ".$name.", Count: ".$c;
return $found;
}

the while loop is executing and will echo only once, when the while loop has finished and will use the last result.

function check($arr,$name)
{
    $found = false;
    $c=0;
    while(isset($arr[$c])&&!$found)
        {
        $found = $arr[$c]['item_name'] == $name;
        echo "Check: ".$found.", search for: ".$name.", Count: ".$c;
        $c++;
        }
    return $found;
}

Now it will echo during the loop as it executes. This is common logic.

Look here for explaination:

http://php.net/manual/en/control-structures.while.php

Zagga commented: Nicely explained +4

Would it not make more sense to get a single upload functioning first, then you can modify the coding for multi upload

"\n" -> new line
"\t" -> tab
"\r" -> carriage return

Dude

but i wont a better explain

pritaes is well respected, and has taken time to help you. You clearly have not checked google, nor the search function on this web site.

All of what you are "wanting a better explaination" on is very easily searched via google. You seem to lack a basic understanding of "DO NOT BIT THE HAND THAT FEEDS".

I have watched the last few threads of yours and it appears you have ripped someone elses code and quite clearly do not know how it functions. Have you actually thought of contacting the individual that created it the first time round?