Squidge 101 Newbie Poster

Here is a script that you could try:

http://stackoverflow.com/questions/51054/batch-file-to-delete-files-older-than-n-days

Or you could opt for powershell

Squidge 101 Newbie Poster

i would suggest you scheduled tasks

Squidge 101 Newbie Poster

That is because your code is upper casing the first letter, then making them all lower case

Swap these around:

ucwords(strtolower(

to be:

strtolower(ucwords(

http://php.net/manual/en/function.ucwords.php

Squidge 101 Newbie Poster
while($row = mysql_fetch_array($result))
{
    $txtname = ucwords(strtolower($row['First.Name'])) . '-' . ucwords(strtolower($row['Last.Name'])); 
    $newstring = str_replace(" ", "-", $txtname);

    echo'<div class="cat-post-desc"><h3>
        <a href="' . $newstring . '.php">' . $row['First.Name'] . ' ' . $row['Last.Name'] . '</a>
        </h3><p></p></div>';

} /** <-- You need to close your while loop

And include the $txtname & $new string in your loop

Squidge 101 Newbie Poster

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'])); 
Squidge 101 Newbie Poster

@cmps,

Sorry i think i had miss undrstood what you were after ^_^.

Squidge 101 Newbie Poster

prestashop is good for ecommerce - in my opion :)

Squidge 101 Newbie Poster

could you not use a pop out window?

Squidge 101 Newbie Poster

Where is your database connection?

Squidge 101 Newbie Poster

Or include the file that has the function :)

Squidge 101 Newbie Poster
Squidge 101 Newbie Poster

Has your first Parse error gone?

Did you change, as has been advised, the short tags?

<td width="10%"><? echo $rows['id']; ?></td>
<td width="30%"><? echo $rows['name']; ?></td>
<td width="30%"><? echo $rows['lastname']; ?></td>
<td width="30%"><? echo $rows['email']; ?></td>

To be:

<td width="10%"><?php echo $rows['id']; ?></td>
<td width="30%"><?php echo $rows['name']; ?></td>
<td width="30%"><?php echo $rows['lastname']; ?></td>
<td width="30%"><?php echo $rows['email']; ?></td>

Does the user you are using in the DB connection have access to the database? Is the table created?

Also change your lines:

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

to:

mysql_connect($host, $username, $password)or die("cannot connect");
mysql_select_db($db_name)or die("cannot select DB");
Squidge 101 Newbie Poster

Also move line 53 out side of your php tag to line 56.

Or change it to

echo "</table>";
Squidge 101 Newbie Poster

stay away from projects until you have a good understanding of the code that you are doing, or using from other places.

Squidge 101 Newbie Poster

try using the FQDN and image.

Example : http://www.example.com/images/email_header.jpg

Squidge 101 Newbie Poster

Is Outlook set to receive HTML emails?

This is not the default setting, normally it is plain text

Squidge 101 Newbie Poster

Do you have any rewrite rules setup?

If not, i am not surprised, the page willl need to be called with the file extension

Squidge 101 Newbie Poster

Welcome to PHP.

Firstly get yourself an IDE, there are many threads on this forum dicussing the pros and cons of different ones. Have a play with them, and find one you are comfortable with.

Either go down the route of installing Apache & MySQL, or install XAMPP or WAMPP. Very straight forward to use. I am on a windows/linux dual boot system and opted for XAMPP (Apache Friends).

XAMPP under windows can be installed with Apache & MySQL as services, although the current model does have a glitch in it. So avoid this. All this means is you will manually have to start MySQL and Apache Server.

Find some easy tutorials to start with so you get a basic understanding. Avoid PHP & MySQL, as MySQL is depreciated. Either opt for MySQLi (good for both types of coding), or opt for PDO (OOP only).

Happy coding :):)

Squidge 101 Newbie Poster

For this you would need to use a javascript call.

http://www.w3schools.com/js/js_popup.asp

Squidge 101 Newbie Poster

Have you tried sending a single email? where $to is a set email address (your own for example).

Have you dumpped your $_GET variable to make sure it is being populated?

Squidge 101 Newbie Poster

Where is the code for send.php or is that what gistfile1.txt is?

This part:

// get meessage to send
$message = $_GET['message'];

// loop through names / emails on index form
for ($x=0; $x<count($_GET); $x++)
{
if ($_GET["mail_$x"])
{
// mail setup
$to = $_GET["mail_$x"];
$subject = "News From Tap ";
$body = "Dear " . $_GET["name_$x"] . "
\n\n $message \n\n Josh \n\n Tap ";
mail($to, $subject, $body, $headers );
}
}

You seem to be using multiple $_GET, but you have one that has an additional space:

Line 16 from Index.php:

 echo "<input type = 'checkbox' name = 'mail_ ".$mailcount++." ' value 

This should be:

 echo "<input type = 'checkbox' name = 'mail_".$mailcount++." ' value 

Note the removal of the additional spacing between mail_ " as this will bugger your $_GET from your if ($_GET["mail_$x"]).

Also the same for this line in Index.php:

<input type = 'hidden' name='name_ ".$namecount++."' value = 

Additional spacing -> beware of those

Squidge 101 Newbie Poster

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.

Squidge 101 Newbie Poster

You need to change to either procedual and carry on using MySQL or change to PDO or MySQLi.

You cannot use OOP with MySQL, this has been covered on a few other threads previously.

Change the usage and you will be fine

Squidge 101 Newbie Poster

A sample of PDO/MySQL connection with exception catch

try {
    $conn = new PDO('mysql:host=HOST;dbname=DATABASE_NAME', $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
    echo 'ERROR: ' . $e->getMessage();
}
Squidge 101 Newbie Poster

MySQL is not capable of OOP unless you use the PDO wrapper. So you will need to change either to using PDO with MySQL, or go to MySQLi OOP.

Is your DBConnector actually returning a live connection? WHat is the content of that Class?

Squidge 101 Newbie Poster

Can you confirm are you using ZF or ZF2?

Also there must be more to the error.

How have you set the error handling?

Squidge 101 Newbie Poster

Why are you using $arr, your variable is, as Diafol has pointed out -> $xml

Squidge 101 Newbie Poster

@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 :):)

Squidge 101 Newbie Poster

Dear davidjennings

Your code is a miss mash of different coding technics.

You are using the MySQLi connection method but as MySQL.

For example:

MySQL

$con = mysql_connect('host','user','password'); <-- Notice no database selected

http://php.net/manual/en/function.mysql-connect.php

Where as your line 2 of code snippet 2 shows this:

$conn = mysql_connect("localhost","user_david","password","djenning_databaseclass"); **<-- You cannot select a database during MySQL connect**

MySQLi

$con = mysqli_connect('host','user','password','database');

http://www.php.net/manual/en/mysqli.construct.php

Sp you must decide which you are going to be using. As you have stated you want to use OOP.

If this is the case you can use MySQLi, or as I have already mentioned PDO with MySQL.

Squidge 101 Newbie Poster

Thanks, I am trying to write functions and some OOP. How would I do this using OOP.

MySQL is not capable of OOP, either use MySQLi or MySQL with a PDO wrapper

Squidge 101 Newbie Poster

Is this using ZF?

Squidge 101 Newbie Poster
Squidge 101 Newbie Poster

As it is encrypted not sure what you expect anyone to do.

Have you contacted FileShareScript?

Have you got the IONCUBE installed?

Squidge 101 Newbie Poster

Whats in your config.php

As Diafol has mentioned the error is in there

Squidge 101 Newbie Poster

I gotta be the dumbest poster on this site... wrong title + wrong forum.

Please mark this solved

Squidge 101 Newbie Poster

Post in the correct forum?

This is PHP

Squidge 101 Newbie Poster

@LastMitch,

Thats the link i couldnt find :)

+1

Squidge 101 Newbie Poster

What is your test platform?

I use XAMPP

http://www.apachefriends.org/en/xampp.html

  • Apache 2.4.3
  • MySQL 5.5.27
  • PHP 5.4.7
  • phpMyAdmin 3.5.2.2

Then use either GIT or PEAR

EDIT Although installing Apache & MySQL as services fails currently under the new GUI

Squidge 101 Newbie Poster

@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.

Squidge 101 Newbie Poster

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

Squidge 101 Newbie Poster

Any errors?

Squidge 101 Newbie Poster

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

Squidge 101 Newbie Poster

This is defined in your other post

Squidge 101 Newbie Poster

$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
Squidge 101 Newbie Poster

oh and remove global $db;

Squidge 101 Newbie Poster

Hi LastMitch,

Think it is bad practice to have the DB call in the class file.

From db.php remove 15 & 16.

Call this from with in function.php

<?php
include("db.php");
function PM() {

        $db = new foo_mysqli('xx','xxx','xxxx','xxxxx');

        $sql = "SELECT * FROM posts";
        $result = $db->query($sql) or die("It's not connecting");
        while($row = $result->fetch_assoc($sql)) {
        echo $row['Content'];

        $db->close();

    }
}
?>

Not sure if that helps. Half asleep now :)

edit: http://devzone.zend.com/255/using-ext-mysqli-part-ii_extending-mysqli/

Squidge 101 Newbie Poster

I have lines changed 5 to 15 in above code, you can not write if in string formation.
remove all your 5 - 15 lines and only add following line.

$q = mysql_query("INSERT INTO kontakte (emri, mbiemri,e-mail,nr,adresa,shenime) VALUES('{$_POST['emri']}','{$_POST['mbiemri']}','{$_POST['email']}','{$_POST['nr']}','{$_POST['adresa']}','{$_POST['shenime']}')");

This is the same as what was in the original POST ^^

Squidge 101 Newbie Poster

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

Squidge 101 Newbie Poster
Squidge 101 Newbie Poster

can you show a few lines before this line

if(isset($_POST['emri'])){
    $emri=$_POST['emri'];
}