veedeoo 474 Junior Poster Featured Poster

What makes the cake better than others as far as your new project is concern? The reason I am asking you is that Cake is not the framework for immersion for the people who hasn't or have not seen the ins and outs of an MVC framework. The write up is so convincing, just drop and start baking. That is not always true I think.

Have you looked at the learning curve comparison on some of the frameworks vs. cake?

What cake can do that other frameworks cannot do or will never achieved, even with extensive libraries and helpers build up?

Possible answer to your question: Check the file permission for those files in question.

below is my screenshot of the installation I made before giving response to your question, and all I did was to give all the files with the proper permission for the user and the group www-data.

e0048ff6094753b1dda75e9cb36167a5

veedeoo 474 Junior Poster Featured Poster

before answering your question, what is your purpose for using the PHP recursive function or a function that calls itself?

Just give me one reason why.

veedeoo 474 Junior Poster Featured Poster

Really, are people unable to do even a copy and paste now? Wow.

We can pretty much see what will be the PHP developers of the future.

veedeoo 474 Junior Poster Featured Poster

You can simply do a simple test.

Check for the upload directory permission

<?php

    echo substr(sprintf('%o', fileperms('/images/news/')), -4);

check for the file upload settings on your php.ini file can also be done this way

echo 'Maximum File Upload allowed: '. (ini_get('upload_max_filesize')) .'<br/>';
echo 'Post Max Size Setting: '. (ini_get('post_max_size')) .'<br/>';
echo 'Server Memory Setting:'. (ini_get('memory_limit')) .'<br/>';

You combine those codes above will pretty much give you the answers.

veedeoo 474 Junior Poster Featured Poster

from the top of my head, all you need to do is copy and paste onto the search box.. OScommerce, zencart, open cart, tomato cart, presta shop, magento community edition.

veedeoo 474 Junior Poster Featured Poster

what are all the testing tool available in PHP?

There is a wapiti vulnerability scanner if you know the basics of python command line interface.

This tool is the best you can get in open source.

veedeoo 474 Junior Poster Featured Poster

Go for the one that you feel in love at first sight.

Personally, I highly prefer PHP over C# or vb.net for web development. I am not saying that PHP is a superior language against the supported languages in asp.net (c# and vb.net), but both of these languages can excel in other applications just like Java et al.

veedeoo 474 Junior Poster Featured Poster

I think new Dwoo is way better than the 2008 release. This is the second template engine I have learned. I think I even suggested the iterator count to the authors back in 2009 and then they disappeared for a few months to do some major overhaul. I thought they will never come back.

The PSRization looks a little odd though, but I would like to give Dwoo another chance as a CI library.

veedeoo 474 Junior Poster Featured Poster

you can add it on your plugin or theme function. I don't have any time to actually check for my answer. However, I did this long time ago and this is how much I can recall.

Warning! *Please check the wordpress codex for validity of my wordpress syntax and make sure they are not deprecated. I did this long time ago and I haven't check on their updated documentation.
*
For example, if I have a plugin called veedeoo_plug and I want to register the PHP session for this plugin in wordpress global space, then I would code it something like this.

function my_session(){

     if(!session_id()){

         session_start();
     }
}

## we need to hook the above function with the wordpress.

add_action('init','my_session');

After adding the codes above, check if there are any errors. If no errors you can assign the session as you would assign them on regular php

$_SESSION['your_session'] = 'foo_bar';

for the add_action reference, please read here.

mattster commented: nice work! +4
veedeoo 474 Junior Poster Featured Poster

Can you please tell me why you need to send two mysql queries during login credentials validation?

For security reason, what these pages tell the user, when they arrived upon redirect?

header ("Location: index.php?look=login&err=nun");
header ("Location: index.php?look=login&err=npw");

these are wrong data types. Supposedly, you want 0 and 1 as an integer or numeric data type.

if ($resulting == "0")

## and
elseif ($resulting == "1")

proofs that the above will always return false if you are referring to the mysql_num_rows response.

<?php

    $x = "0";
    $y = "1";

    var_dump(is_int($x));

    echo '<br/>';

    var_dump(is_int($y));

the above will return

bool(false)
bool(false) 

which is nowhere close to either presumed returned values of either

$resulting = mysql_num_rows(mysql_query("SELECT * FROM members WHERE loginname='$post_username' and password='$post_password'"));

or

 $user_datagain = mysql_fetch_array(mysql_query("SELECT * FROM members WHERE username='$post_username' and password='$post_password'"));

Both of the queries above will return an integer that's for sure. You can read more about data-types in mysql here.

I strongly suggest that you should reconsider re-writing your script's logic construct.

veedeoo 474 Junior Poster Featured Poster

You can build your portfolio similar to whatever is the common requirements in your area.

Allow me to use my situation as an example, I can breakdown 3 distinct requirements in the state of California. If I want to be employed as a back-end developer in Orange County, then I need to show three different portfolios in MVC frameworks e.g CI, Symfony2, Cake PHP. Some requires knowledge in Wordpres too.

San Diego Country is pretty different though most of the time frameworks are not even mentioned, but they put a lot of emphasis on bootstrap as if it is the one running both the back-end and the front-end.

While others don't mind about PHP framework Interoperability Group suggested Standards, some are anally retentive ONLY to PSR2 and the position of curly brackets and tab vs. spaces .

In Los Angeles county and Ventura county, I would add template engines like smarty and twig, including some knowledge in Magento. As I go up north to Silicon valley, Zend framework, Kohana, Symfony2,Laravel, and CI dominates MVC frameworks requirements and for the template engines Twig and Smarty are the most commonly used in this area. Silicon valley also look for someone who have basic knowledge of composer, vendorization, PSR0 to PSR4. They just love anything that can either kill your server or test its limits.

While others don't mind about PHP framework Interoperability Group suggested Standards, some are anally retentive ONLY to PSR2 and the position of curly brackets and tab …

veedeoo 474 Junior Poster Featured Poster

another thoughts..

you can also count the PROCESSLIST to find out if you are on the max connection allowed , then let the next connection to sleep, check on wake up and then sleep if there is not available slot, else let the processes to continue. 150 is a lot of connections already, but I have seen people have it set to more than 4000.

The safest and most elegant ways of doing this is probably increasing the max_connections value to some desired number, but reasonably fair to the database server to handle.

veedeoo 474 Junior Poster Featured Poster

There was a book written for this. I believe the title was "Drupal 7 module Development". You really need to get this book. Online tutorial will not suffice to acquire professional knowledge.

I forgot to mention, the book was published by packtpub sometime between 2010 and 2012. I don't remember the author's name.

Book that I purchased sometime ago:
"Definitive Guide Drupa 7" from apress.
Drupal building blocks
Pro drupal development. (I can't remember the exact title).
Design and Prototyping for drupal

veedeoo 474 Junior Poster Featured Poster

The script above should have at least more than 2 errors.

this alone will give an error

if (isset($_POST['submit'])) //&& ($_POST['submit'] == "Submit")){`

because this part has been commented out and it will break the if statement

//&& ($_POST['submit'] == "Submit")){`

if you uncomment the above, this will give you another error

{`

the back quote will definitely give you an error.

and this

<input type="submit">

cannot be process, because it lacks the name attribute. It has to be something like this

<input type="submit" name="submit" value="Submit">

Not until you changed your form submit codes, you will not be able to use this

if (isset($_POST['submit'])){

    //do whatever

    }

the ['submit'] part of the codes refers to the name attribute of the submit button.

One last thing, and I hope would be the last is the OR expression.

 || ($_POST['submit'] == "Submit"))

The script will only allow you to have this kind of expression if the form submit button has been defined like this.

 <input type="submit" name="submit" value="Submit">

Fix your code first then add this on progress1.php

if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {

    print_r($_POST);

    //or

    // var_dump($_POST);

}

the above should give you form data array submitted through POST.

veedeoo 474 Junior Poster Featured Poster

Honestly, I think you should have not accepted the project without knowing the core requirements.

I am not insinuating here that you won't learn the frameworks, but if you haven't seen these frameworks before, I couldn't help myself not to think that you are indeed in a big trouble from the moment you took the project.

for codeIgniter, read it here.
for YII, read it here.

Make sure to read both of the links I have provided. If by any chance, it gives you a really bad after taste, make sure to return the project and be honest to your client. That is only my humble opinion.

veedeoo 474 Junior Poster Featured Poster

Honestly, your query looks good to me. Unless, you made a mistake in referring to the image.

<img src="directory/<?php echo $row['image'];?>" />

should give you something like this

<img src="directory/mpb.jpg" />

remember you query looks for the minimum price for each Product_name and not the MIN of all prices. Still, this scenario will not create an image mismatched.

veedeoo 474 Junior Poster Featured Poster

I am also a big fan of the separation of business logic and presentation logic. In fact, I have attempted to create a very simple template engine that can run simple html rendering from a parent text file serving as the main template file.

For the sake and for the support of the above tutorial, please allow me to contribute something I think will be helpful to others.

We can easily achieved dynamic templating without even creating a multiple template files. However, as the application gets bigger, the server resources becomes the main bread and butter of this method. So, please use this technique sparingly.

This idea came up to me when a friend from github have asked me to contribute on codeIgniter dynamic application creation project. It is something that hasn't been release to this date, but I will modify my codes to prevent any confusion and also in fairness to the person whom I have given the permission to use the snippet.

This is pretty much inspired by the smarty templating engine. The only difference is that this will not compile, but rather deliver the content directly after they are prepared.

Let Say we have an Obejct Oriented written application that will output an array. This array can be any data types. In order to implement or take advantage of the server side doing the lifting, we can change our back-end development perspective a few angles from either the left or the right of the norms. I know …

mattster commented: That's brilliant! Thanks! +4
rubberman commented: I appreciate the comment and suggestions. Thanks! +12
veedeoo 474 Junior Poster Featured Poster

in addition, you may want to get familiarize with the drupal file system. Like many other applications not written in strict MVC design pattern, Drupal is built on the common application design "includes and modules". So anything that you want to alter in this CMS will be either in includes directory or in modules directory.

The modules in drupal is module literal. Meaning that if you want to add,create, edit, modify functions and classes, then it can be done in modules/module_name directory..

I would say, you will probably spend about 2 days on this and you should be an expert. This is an easy application compared to developing an app on MVC frameworks.

It's all about the hype on "wanted drupal programmer/developer", you should be fine if you already have more than 6 years of developing PHP applications.

veedeoo 474 Junior Poster Featured Poster

Honestly, I kind of like the gimmeDotSupport. It is pretty straight forward I think.

veedeoo 474 Junior Poster Featured Poster

Most are using database, but I prefer storing it as xml file similar to how the symfony2 stores its AsseticBundle configurations as xml files.

veedeoo 474 Junior Poster Featured Poster

for the template name or style name, you can either store it in database or in xml file.

veedeoo 474 Junior Poster Featured Poster

are talking about this extension? Can you tell us exactly, which page these spams are originating from? Is it on your catalog?

The reason I am asking is that, I know open cart is written in MVC and knowing the origin of the spam can lead us to the controller file.

veedeoo 474 Junior Poster Featured Poster

you can add fwrite on the alert_url and write the response to a file.

veedeoo 474 Junior Poster Featured Poster

try var_dumping the response from payza. In this case it should be the $info. Also, try var_dumping the $response just below the cURL's curl_close() call.

veedeoo 474 Junior Poster Featured Poster

it does not check if the function exists or method exists before even calling a function or instantiating an object.

Just for clarification, what I meant by the above statement is that it is more aimed for the instance of rather than a literal function_exists. Instance of can be carried out by either factory or a singleton of which I strongly believe magento must have either one or both.

veedeoo 474 Junior Poster Featured Poster

IMHO, the only way to push the footer down and keep it there is to have a wrapper that will have a minimum height of 100% and then we can place the header, content and footer inside this wrapper. The content div must have a bottom padding equivalent to the height of the footer.

something like this

<div class="wrapper">
    <div class="header"> header here </div>

        <div class="content">content here</div>

            <div class="footer"> footer here</div>
<!-- end of wrapper -->
</div>

a simple css can be as little as

html
body{
    height: 100%;
    }

/* we define our wrapper to have 100% height. */

.wrapper{
            min-height:100%; /* this should fill up the entire body */
            position:relative;
        }

 .content{

                padding-bottom:150px;  /* this should be the desired height of the footer */

        }

 .footer{

         height:150px;
         bottom:0;
         position:absolute; /* I am not sure, but this should be important */
       }     

Others may have a better idea. I must admit, I am not so savvy with advance CSS, because I don't normally write these stuffs from the scratch. I always have someone do it or just use either bootstrap or foundation.

veedeoo 474 Junior Poster Featured Poster

I don't have the source of Magento, but what the error tells us is that whatever is the object of the method getPosition(), it is not being instantiated.

You will have to find this on your codes. Please read the codes below as instructions and not the actual method of the core type.php, because I am shooting lots of blanks and guesses here.

Assuming that the instance of an object of a getPosition() method is $some_x, then the source codes will have some kind of method that can instantiate the object from either a remote class or within its namespace.

public function above_line_854($some_x, $some_y, $some_z){

## I am not sure if there is an actual $some_y and $some_z, but I am sure there has to be some $some_x in the code. Otherwise, you will not be getting and error of $some_x.

$x_position = array(
                ## my first guess
                $some_x->method_of_x()->getPosition(),
                ## my other guess
                $some_x->another_method(), 
                ## my not so sure of a guess, or maybe something like this
                $some_x->getPosition(),
                );

}                

I hope my assumption on the source code is close enough. Anyways, what I am trying to tell you here is that your script have lost its connection or its ability to trigger an instance of of $some_x whatever it maybe in the source code. You just have to figure how to get that $some_x.

If some_x is a lone function and is not a dependent of any object, then look for that function and make sure the file …

veedeoo 474 Junior Poster Featured Poster

I forgot, If you can access your httpd.conf, you can edit it like this as per apache's instructions. Make sure the dir_module is installed though.

<IfModule dir_module>

DirectoryIndex index.html index.shtml index.html.var index.htm index.php3 index.php index.pl index.cgi

</IfModule>
veedeoo 474 Junior Poster Featured Poster

you can try

DirectoryIndex index.php

try adding that to your .htaccess file either in the root or your directory in question and let us know if it work. You can read more about this topic here.

veedeoo 474 Junior Poster Featured Poster

OMG veedeoo did you bomb the bully? I guess that would have been pretty cool but one helleva scare if the guy ended up dead!

lol :). No, I did not bomb the bully. I electrocuted him, but not in my wildest imagination my gadget would even work.

My Dad did a lot of experiments on electrical autotransformers. I witnessed him converting a regular outlet voltage to thousands and thousand of volts, but these voltages carries a very minuscule amperage in them. For some reason, it gave me an idea creating something to defend myself and so I did build my portable electricution probes.

I bought the cheapest sine wave generator from radio shack and wired the input from my scooter's battery. I connected the output to the autoransformer. I placed the battery and the transformer inside my backback that entire week. I was patiently waiting for the bully to come close to me at arm lenght just like he did the last time. I was wearing my gadget jacket to hide the probes taped on my arms.

I think it was the Gods of Olympus who have hearkened to all of my prayers that week. The bully came up to embarass and harass me even more, but I was ready. When the distance was just perfect, I shoved the probes to his abdomen, and little I knew that this bully kid would fell like an statue with his face first. Sparks were everywhere and my heart was …

veedeoo 474 Junior Poster Featured Poster

can you show us your codes?

Normally, the page that will be running the facebook api will have codes like this

<?php
require_once('autoload.php');
use Facebook\FacebookSession;
use Facebook\FacebookRequest;
use Facebook\GraphUser;
use Facebook\FacebookRequestException;

FacebookSession::setDefaultApplication('YOUR_APP_ID','YOUR_APP_SECRET');

// Use one of the helper classes to get a FacebookSession object.
//   FacebookRedirectLoginHelper
//   FacebookCanvasLoginHelper
//   FacebookJavaScriptLoginHelper
// or create a FacebookSession with a valid access token:
$session = new FacebookSession('access-token-here');

// Get the GraphUser object for the current user:

try {
  $me = (new FacebookRequest(
    $session, 'GET', '/me'
  ))->execute()->getGraphObject(GraphUser::className());
  echo $me->getName();
} catch (FacebookRequestException $e) {
  // The Graph API returned an error
} catch (\Exception $e) {
  // Some other error occurred
}

Noticed the require_once('autoload.php')? that is a requirement and part of the distribution.

veedeoo 474 Junior Poster Featured Poster

You need to give us your form codes.

If you have one like this

<form action="" method="post">
<input type="text" name="username"/>
<input type="password" name="password"/>

<input type="submit" name="submit" value="login">

</form>

then the above codes should be wrapped with this statement

if(isset($_POST['submit'])){

    //put all of your codes here



 }   
veedeoo 474 Junior Poster Featured Poster

Hi and welcome.

veedeoo 474 Junior Poster Featured Poster

besides from using the deprecated mysql_ function, your query is not properly constructed.

It should be constructed like this. Assuming that the $db is the persistent database connection. Make sure to add an error catcher. I am just giving you the most basic example.

$result = mysql_query($query,$db); 
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){

     echo $row['username'] . " " . $row['userrole'];

        echo "<br>";
}

to close the connection

   mysql_close($db);

Although it is not a problem to use $try as variable, it is highly recommended not to use PHP reserved keywords at all cost.

remember $db is something like this

$db = mysql_connect($dbhost, $dbuser, $dbpass);

if you don't want it like that, this will work also, but you will have to remove all the reference to $db from my example above

mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db("Your_database_table") or die(mysql_error());

$query = "select * from login where username = '$username' and userpass = '$userpass'"; 

$result = mysql_query($query); 

while($row = mysql_fetch_array($result, MYSQL_ASSOC)){

     echo $row['username'] . " " . $row['userrole'];

        echo "<br>";
}

then you can close it like this

mysql_close();
veedeoo 474 Junior Poster Featured Poster

can you open one of them or at least when you see this

<script runat="server">

you might also see something like this

var sys = require("sys"),http = require("http");

that is for the server side js e.g. node.js .

veedeoo 474 Junior Poster Featured Poster

Graduated High School From the world class Tech Magnet School here in California. Although we have football field, I don't know much about playground, I am sure we don't have one. All we have were computers and finest mathematics teachers. Some kids are too young to be in High School. We have more mathematics, sciences, and computer geniuses than any high schools in the US of A.

Pretty much kids graduating at the age of 18 is considered pretty old at my school. There are many fine looking geek girls and that is a plus being in tech magnet school.

Junior/Senior prom were not as colorful as any other high school in the U.S., we have less dancing but have more laptops and bow ties in the dancing hall, for us geeks this is the night we can show what we can do behind the black box. We can hack any wires that have some signs of logic in them.

Just like iamthwee, I was bullied once, but I showed the big guy what the geek can do. Good thing the poor bully kid made it to the hospital, but I was very sorry for inventing something I shouldn't.

iamthwee commented: LOL +0
veedeoo 474 Junior Poster Featured Poster

What is certain though is that, people will buy paper and mechanical pencil with eraser or paper ,pencils without eraser and eraser. But less likely to buy just an eraser and very seldom even-never buy a combination of paper and eraser. Did you see the logic behind this? So, based on this example we have discovered two weak products. What are they? Can you tell me the Algo's probable approximation? What would be the Algo's top product combination if any?

veedeoo 474 Junior Poster Featured Poster

why not record the sales on different table and sort the best combination or group of products that sell the most. Don't make it too complicated. All you need to do is define your own restrictions. e.g number of item sold, which pair of products are the top selling. But IMHO, it is more of a speculation though. We are betting on the odds that customers will be buying the same items based on the Algo's approximation.

The thing is nobody can calculate the degree of the influence of the environment. For example, we cannot prove that in the month of December ice cream and sugar cone combination will have the same sales as during the months of June, July, August and early September. Relying on this combination can cause an over-froozed ice cream and soggy sugar cones. Besides, no one can really predict what will be the trend a week from today.

This is how the data mining company makes money, and so as the buy on red and sell on green infomercials.

veedeoo 474 Junior Poster Featured Poster

How about Welcome and Hello.

veedeoo 474 Junior Poster Featured Poster

should be like this

 $dataid = mysql_fetch_array($studentidResult);
veedeoo 474 Junior Poster Featured Poster

line 47: comparison operator incomplete.
line 47: php closing tag needed.

You need to complete this statement

if($expires > 

and after the statement, you need to close your PHP

?>

so that the parser will know where to stop parsing.

veedeoo 474 Junior Poster Featured Poster

Both will be good and this new password_hash function from PHP.

veedeoo 474 Junior Poster Featured Poster

index.html must be save as index.php also. Otherwise, anything with <?php will not be parsed by the PHP parser.

There are alternatives to .php extension. PHP parser will parse any files with these extensions

.php
.php3
.php4
.php5
.phtml
.inc // carefull with this one. the source can be viewed from the browser
.tpl
veedeoo 474 Junior Poster Featured Poster

I can't tell you exactly what went wrong. However, is this the same SDK V4 you are following?

veedeoo 474 Junior Poster Featured Poster

session is pretty much the standard my friend. Assuming that the users don't turn off their cookie, still you will have to save it to your database for verification.

Session will not slow your server to a halt. In today's standards and specifications, the load on the tmp directory is minuscule.

veedeoo 474 Junior Poster Featured Poster

Can you give me your rewriteBase value?

the value for the rewriteBase should be the directory the joomla is installed. For example, if joomlas is located in

    www/joomla

then your .htaccess rewriteBase will be

rewriteBase /joomla

so, pretty much without the joomla's default comments on the .htaccess file, it should look like this, exept for the installation directory

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]

RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]

RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})

RewriteRule .* index.php [F]

RewriteBase /joomla

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_URI} !^/index\.php

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d
veedeoo 474 Junior Poster Featured Poster

set $dbtype to

    public $dbtype = 'mysqli';

instead of mysql

veedeoo 474 Junior Poster Featured Poster

This might not be the answer to your question, but I still want to bring it up for clarification.

When you created the database user on your cpanel, did you grant this user the proper privileges?

Is the user allowed to access and have privilege for the database?

veedeoo 474 Junior Poster Featured Poster

Please ignore my reponse. For some reason, we posted our responses almost at the same time.

echo '<a href="'.$dirpath.'/'.$file.'"> Click here to download '. $file .'</a>';
veedeoo 474 Junior Poster Featured Poster

I don't understand the need of storing an instance of an object into a session. There are many ways in finding out if an instance of an object is present. There are singleton, factory, and instanceof PHP function that can be utilized. It does not take much to use them.

Can somebody please explain why is this indispensable?