veedeoo 474 Junior Poster Featured Poster

ok, after looking at your code, I decided to tweak my recommendations above.

Before anything else, we need to do some refactoring on your codes. All of the methods responsible for video data shares the same properties and variables.

for example let us take a look at the simple table below

+------------+-------+------+-------+--------+-------+-------+-------+
+ Provider   + thumb + size + embed + iframe +  url  + site  + title +
+------------+-------+------+-------+--------+-------+-------+-------+
+ youtube    + false + true + false + false  + false + false + true  +
+------------+-------+------+-------+--------+-------+-------+-------+
+ imgur      + true  + true + false + false  + false + false + true  +
+------------+-------+------+-------+--------+-------+-------+-------+
+ deviantart + true  + true + false + false  + false + false + true  +
+------------+-------+------+-------+--------+-------+-------+-------+ 
+ soundcloud + true  + true + false + true   + true  + false + true  +
+------------+------------+---------+--------+-------+-------+-------+

With simple analysis of the table above, we can easily draw a simple conclusion that the nearest values of the columns where the video providers can have very minimal differences is when we define the default values as shown on the table below..

+------------+-------+------+-------+--------+-------+-------+-------+
+ Provider   + thumb + size + embed + iframe +  url  + site  + title +
+------------+-------+------+-------+--------+-------+-------+-------+
+ default    + true  + true + false + false  + false + false + true  +
+------------+-------+------+-------+--------+-------+-------+-------+

All video providers are also utilizing either oembed_size() and oembed_title() OR og_size() and og_title methods. All video providers also uses these variables $code and $res.

Those …

veedeoo 474 Junior Poster Featured Poster

Let me work on it.. I'll post it tomorrow evening my time zone western pacific.

veedeoo 474 Junior Poster Featured Poster

I don't mean this personally, but the class above will eat the server resources like a hog.

It is a class of too many methods. One probable solution I can think of is to break this class into multiple classes. There is a design pattern called Abstract Factory/Factory Method patterns which I think can work greatly on this type of application. Most importantly, if you are aiming for cache system.

The implementation of Abstract Factory/Factory Method patterns is kinda like this. ( Mr. LDA above thought me how to this, so any corrections are greatly appreciated). It appears to me that the class above is responsible for providing video contents coming from the external sites.

We can make a video factory class like this

class VideoFactory
{
    private $ytube_content;
    private $imgur_content;
    private $dmotion_content;
    private $flickr_content;

    public function __construct(YouTube $ytube_content, Imgur $imgur_content, DailyMotion $dmotion_content, Flickr $flickr_content)
    {
        $this->ytube_content = $ytube_content;
        $this->imgur_content = $imgur_content;
        $this->dmotion_content = $dmotion_content;
        $this->flickr_content = $flickr_content;

     }

     /*
     * get the youtube data
     */

     public function get_youtube()
     {
         return clone $this->ytube_content;
      }

      /*
      * get imgur data
      */
      public function get_imgur()
      {
          return clone $this->imgur_content;

       }

       /*
       * get dailymotion data
       */
       public function get_dailymotion()
       {
           return clone $this->dmotion_content;

        }

        /*
        * get flickr data
        */
        public function get_flickr()
        {
            return clone $this->flickr_content;

        }


} 

the video classes as broken down

class YouTube
{

    public function __construct()
    {
    }

    public function set_video()
    {

        //return all youtube video data

     }

     public function make_cache()
     {
         //you can make a …
SimonIoa commented: thanks veedeoo +2
veedeoo 474 Junior Poster Featured Poster

I guess you can store the them in session as an array.However, before doing so, you need to fix your form first.

veedeoo 474 Junior Poster Featured Poster

The owner might be referring to a function that is already on the script or function you need to create.

It is really hard to speculate what the owner meant by "use function", until you show us some codes.

veedeoo 474 Junior Poster Featured Poster

I Honestly believe that balance carry forward has nothing to do with PHP. I am assuming that this teminology may have something to do with financial reporting, or any calculation reflecting a remainder critical for the next calculation. Unless, I completely missed this subject matter.

I don't feel like giving any recommendations to you, because just like what you have already said you may have started web development before Broj1.

However, let us do a simple analysis of what is the probable meaning of balance carry forward as it relates to programming.

So, we have cycle where x was 100 units some 60 days ago and for each day x can shed as y at approximately point and a half per day . During repetitive cycles, the units are assigned between variable x and z and any gain in units are defined by either variable a or b. Of course, the increase can be added to either x or z before or during the cycle.

$x = 100;
$y = 1.5 * 60;

if we are to calculate the value of x that can be carry forward to the next cycle, then codes below can be use

$z = $x - $y;

The value of $z is the balance that can be carry forward for the next cycle. If some variable $a increase $z by 200, then you will have $z + $a to shed away for the next cycle.

That would be my take on this subject …

veedeoo 474 Junior Poster Featured Poster

you need to echo this whole thing

<input type="text" name="ptype" id="ptype" value="<?php $SCYQ64TYPE1 = $ex1["SCYQ64TYPE"]; echo $SCYQ64TYPE = trim($SCYQ64TYPE1) ?>" readonly >

and this one

if($q!='')

should be written like this

if($q!=='')

Alternatively, Gabriel is correct about JQuery option. It is a lot easier to use jquery libraries.

veedeoo 474 Junior Poster Featured Poster

@V, dude I like your style :).

Cool, but I forgot the semicolon on

$this->dialog = $dialog;
veedeoo 474 Junior Poster Featured Poster

In practice, MVC pattern is not as complicated as my drawing above. They are in fact easy to learn. The secret of learning is to go back to the basic "hello world" program introduced to us when we first met PHP and to follow the progression of PHP during its evolution.

Let us follow the breadcrumb trail of PHP in simplified approach.

Learning the advance OOP and MVC design patterns is somewhat very tricky. Remember the basic "hello world" program introduced to us?

<?php

    echo 'Hello World';

most books will tell us to give ourselves a good pat on the back and then welcome us as a newly anoited PHP programmer. Most books and online tutorials are guilty of excessively anoiting their readers. I honestly believe that this is only for the purpose of boosting the newbie's confidence. However, they were not prepared for the future evolution of PHP.

The first sign of evolution of PHP. "Let there be function" and overnight we learned how to write a function.

<?php

    function sayHello($dialog)
    {

       return ($dialog);

     }

     echo sayHello('Hello World');

Sooner than we can imagine, everyone on the web were talking about how reusable the functions they have created. Wait a minute, someone just claimed that PHP is also an Object oriented language? Huh! you must be kidding me! scream one of the Java coder.

By this time, many PHP programmers stayed with the old method of writing PHP applications, while others move on to the Object Oriented Programming. …

Lorele commented: Absolutely stellar. Hello, Universe. +0
veedeoo 474 Junior Poster Featured Poster

Another example

Server
    +Apache + MySQL + PHP
        + CodeIgniter + other open source
            + Your Application which is not an open source
                + Payment gateway - external services
                    + Shoppers - end-users

if the shopper's credit card information are stolen, who is responsible between you, codeigniter, Apache/MySQL/PHP AND between you and the payment gateway? Assuming the four before your application are licensed BSD and MIT? How about between your application and the Payment gateway?

how about

 Server
    +Apache + MySQL + PHP
        + Magento + other open source
            + Your Application which is not an open source
                + Payment gateway - external services
                    + Shoppers - end-users
veedeoo 474 Junior Poster Featured Poster

e.g. student management application

You
 YOUR SERVER + Application
    + School = your end-user
        + Students = school's end-user

Take the simple example above. If some delicate information are forcefully taken from the application you wrote e.g. grades, student id, name, email address, class schedule, grades , and anything that are considered private. Who has the ultimate responsibility?

A scenario, a hacker broke into your application and start changing the grades of the students. Who's responsibility is this? Are you prepare to recover from this? How about a back-up for data recovery?

What can you do to protect yourself if such hideous things occurs?
Do you believe in "Code Of Ethics for Programmers and Developers"?

Or should we let the application run without any regards to the school and student's rights of Privacy. Or maybe, we can let the school handle the chaos and let them lie about pretty much everything without accepting responsibility on our end?

What would be the appropriate EULA and TOS for the above?
Maybe you don't need one, don't your think?

veedeoo 474 Junior Poster Featured Poster

if you run your code in the console environment like CLI in PHP, this

<!DOCTYPE html>
<?php

?>

can create problem. You just need to reconsider what you wrote on your code editor. Think about which comes first and last?

so, if submit button is set, the user gets redirected, and what should be shown to the user if it is not set? Should we wrap the html codes inside the else statement or should we not? Think about it and you will be solving this problem like pro.

veedeoo 474 Junior Poster Featured Poster

First, I honestly believe that you should consult a copyright attorney. There is no way I have the training and any knowledge in giving legal advice in software licensing. Software licensing is one of the most complicated one to understand.

Most developers engaged in enterprise level open sources applications e.g. yours truly and Mr. LDA. Tend to select the license that will cover the things that we fear the most. We have three licensing schemes on the applications that we write DBD(don't be a dick), MIT, and GPL. For all scripts and snippets we published on blogs and forums, we tend to give it DBD and MIT. For our distributable applications we shoot for GPL.

A good example, PHP is lincense under BSD. Why does PHP opted to take the BSD license? The reason is that, you can build any application in PHP secured or not so secured, the front-end user will not be able to file a lawsuts against PHP. In other words, if your PHP written application has been hacked by some obnoxious hacker, your clients will not be able to file a legal actions against the core of your application which is PHP.

Now, when it comes to your propriety license, you can probably have put it out in MIT or BSD.

My reasoning behind having it release in BSD or MIT is that they cannot modify any accessable source codes of your application without notifying you first. MIT allows you to separate …

veedeoo 474 Junior Poster Featured Poster

There is nothing wrong, but why?

<input type="file" name="0" id="box">

I hope you are aware that it can be viewed as an integer and maybe bolean if not careful.

$x = 5 + "0 cups of coffee";

$y = 5 + "5 cups of coffee";

will give $x = 5 cups of coffee and $y = 10 cups of coffee. What I am saying here is that both $x and $y are integer at this point. While

$x = "0"; 

is a string. If we check (isset($_POST['0'])), gues what we are going to get?

Be careful with your data types..

veedeoo 474 Junior Poster Featured Poster

I hope Mr. LDA don't mind me posting response on this thread.

Do you have composer.json inside your node directory?

veedeoo 474 Junior Poster Featured Poster

for html5, you can probably use object like this..

<body>
<object name="header" type="text/html" data="head.html"></object>
<br />

<object name="footer" type="text/html" data="footer.html"></object>



</body>

I am not sure though, but you can refer to the documentation here.

I am not really sure if we can use two objects ..

Update: yes we can use two. I updated the codes above.

veedeoo 474 Junior Poster Featured Poster

you can also try and look at video.js.

veedeoo 474 Junior Poster Featured Poster

as per the title of your thread where it says "XAMPP", you need to start the xampp control panel and then start the apache and mysql services.

then direct your browser to localhost/youphp_file.php

You cannot save pages with PHP codes in them as .hml document. You can however save php docs with .inc, php3, and if supported phtml or as defined in your directoryIndex directives.

veedeoo 474 Junior Poster Featured Poster

two ways you can do what you wanted.

first, can do it with javascript.
second, add this above your image submit button

<input type="hidden" name="submit" />
veedeoo 474 Junior Poster Featured Poster

can you give us the object of nusoap and the method you want to pass the are array?

veedeoo 474 Junior Poster Featured Poster

here are the screenshots of the server in the virtual box being access by firefox in the host computer

8eaff26fa3d646e0b4b73deb4065653d

Just for the purpose of this discussion, I skinned the ubuntu server with Lubuntu skin and installed the firefox as well so that I can take screenshot of the localhost inside the virtual box.

4acb92ab0acbec42518d90acbc4a4888

I hope you will be able reproduce everything we presented on this thread. I am confident we have already given you enough information on how to set your server andnetwork settings on the virtual server and host computer. What we did not give is the instruction on how to install apache2 on the virtual server. However, I sincerely believe that there is an abundance of tutorials available on the web. If you ever find any problems installing apache, mysql, php on linux, please free to start a new thread.

Good luck....

veedeoo 474 Junior Poster Featured Poster

Per your message, why windows 2008 with WAMP on virtual machine ?
why not linux with LAMPP, if this is going to serve web contents?

besides if you are using VM Virtual Box, it does allow you to install different os's. So, if you really need to have a windows 2008, then install it in different virtual drive, and then install the linux e.g. ubuntu, redhat, fedora, or whatever is more easier for you to work on.

The scenario that I am imagining right now is that

you have windows os as host opereating system ?
you have a virtual box installed in this os?

Here is an example with screenshot just to make points a lot simpler to understand.

Host computer OS: Windows : IP address by way of ipconfig : 1xx.xxx.x.xxx

Guest : Virtual Box with multi-operating system. ifconfig shown on ubuntu terminal : ifconfig 2xx.xxx.x.xxx

let say we have defined our development domain as development.dev which is hosted inside the virtual box by ubuntu server and the windows/system32/etc/hosts has these entries to make sure every http request for development.dev gets forwarded to the ubuntu server in the virtual box 2xx.xxx.x.xxx

the host computer host file entry

2xx.xxx.x.xxx development.dev

The idea is to be able to ping the ubuntu server in the virtual box. All browser request to development.dev will be serve by the apache2 in the ubuntu server inside the virtual box.

Below is the screenshot of a virtual box with ubuntu server

veedeoo 474 Junior Poster Featured Poster

certain monster has 3 items

check the varchar(xx) value on your database structure. Is it enough for monster name characters?

veedeoo 474 Junior Poster Featured Poster

You should run ipconfig on your command prompt whenever this type of error happens. It appears to me that it is an IP related problem. There is a much more reliable DNS service that will auto-update whenever your IP address changes. The free service is provided by freedns.afraid.org. They also provide auto-ip update through curl, wget, and direct url. I can't find the link but they also have a bat file that can run in the background and send any changes on your IP address for the domain names registered under your account.

I have suggested Uniform Server, because I honestly believe that this is more stable than any WAMP appliance ever created. Most WAMPP and XAMPP releases will not pass the suggested standards of live hosting. They solely designed for development with intra-network access.

I have no involvement with uniform server, but I think they cover many security vulnerabilities in running Apache, mysql, php in windows environment.

Some great options available in uniform server
can run a portable without relying so much on your windows resources
create a virtual host in an instant.
change the server configuration file from development to production server
error reporting can be disabled.
accessibility report internal and eternal (from the iternet).
IP checking.
Cron jobs
and many more.

Please take a look at the screenshot provided below running from USB drive and serving my client's development website. Yes, this tiny server can be access …

veedeoo 474 Junior Poster Featured Poster

The ID on your second table must be set to auto-increment. Another possible problem ahead is that you have too many identical columns between 1st and 2nd tables.

2nd table can be something like this . Assuming that the game serve like a category.

+----+--------+--------+--------+
+ ID +  ITEM  +  GAME  + LOG_ID +
+----+--------+--------+--------+
+ 1  +  test  + spider +   1    +
+----+--------+--------+--------+
+ 2  + test3  + spider +   1    +
+----+--------+--------+--------+
+ 3  + test4  + spider +   1    +
+----+--------+--------+--------+

You can sort and update the second table based on the validated user credential from the first table.

veedeoo 474 Junior Poster Featured Poster

on your hosts file on the host machine give it a directives as IP of the virtual machine e.g

xxx.xxx.x.xx alias or domain name of the server in the virtual machine

if that does not work, read my other response on the other thread you have posted a while ago.

veedeoo 474 Junior Poster Featured Poster

Your information is not complete. Please let us know the following

Are you hosting your own site on your desktop?
Is your desktop IP address static?
Have you look into Uniform server, before deciding in using WAMP?
Which DNS service are you using?
Does it auto update as your IP changes?

**Instructions below DOES NOT APPLY for LINUX, UBUNTU and other linux derivative servers. ONLY for Windows serving Apache2,MySQL and PHP
**
if the above does not apply, which hosting company are you with? If you are not hosted by a hosting company, then this settings may help you.

hosts file in windows is for the local directives ONLY! Say, we have a development server in c:\wamp\htdocs\yourDomain\ and we want our browser to access it as www.YourDomain.com, then the entries on hosts file in c:\windows\System32\etc\hosts will be something like this

127.0.0.1 yourDomain.com

If you want your development site to access from the local network machines and EVEN from the Internet, then the entries for the virtualhost in wamp\apache\conf\httpd-vhosts.conf

will be something like this

<VirtualHost *:80>
        ServerAdmin webmaste@yourDomain.com
        DocumentRoot "C:/wamp/htdocs/YourDomain"
        ServerName YourDomain.com
        ServerAlias www.YourDomain.com *.YourDomain.com
        ErrorLog logs/YourDomain.com-error-log
        Custom logs/YourDomain.com-access.log common
 <Directory "/wamp/htdocs/YourDomain">
     Options Indexes FollowSymLinks Includes ExecCGI
     Order allow, deny
     Allow from all
 </Directory>

</VirtualHost>  

So, what I trying to tell you here is that if the YourDomain.com is a valid domain, then both of the directives I provided above will work for local access and Internet access to your website. PROVIDED that …

veedeoo 474 Junior Poster Featured Poster

This is possible with ajax and jquery on the client side. While on the server side, ASP, PHP, python, ruby, and node.js.

veedeoo 474 Junior Poster Featured Poster

if you are using PHP then you can probably use file_get_contents and store the output into your mysql database. Before doing that make sure to use base64_encode the html source to prevent any complications. Use LONGTEXT, Others may have different ways of doing this.

veedeoo 474 Junior Poster Featured Poster

take a look here and let us know.

veedeoo 474 Junior Poster Featured Poster

Here is a simple derivative of the linked thread above.

I want to let you know that this is also a hybrid ( PHP and Javascript). I don't normally use server side time in displaying user time zone related content, but we need a reliable time reference.

our simple function.. save as cases.php

<?php

    function get_cases()
    {
        ## define current server time
        $time = time();

        ## define time beginning e.g. january of this year
        $beg_time = strtotime('2014-01-01 00:00:00');

        ## calculate elapsed time since beg_time
        $elapsed_time = round($time - $beg_time);


        ## return everything as array 

        return array( 

            'time'=> $time, 
            'case_today' => round(($time - (strtotime("00:00"))) / 1.7), 
            'beg_time' => $beg_time, 
            'elapsed_time' => round($time - $beg_time), 
            'ytd_cases' => round($elapsed_time / 1.7)

            );
    }


    $res = get_cases();

    ## test if we can access array output
    //echo $res['beg_time'].'<br/>';
    //echo $res['time'].'<br/>';

 ?>

The page that will display your incrementation. Save as counter.php

<?php
    require_once('cases.php');

?>


<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript">

        function getCurrentTime(){

            return <?php echo $res['time'];?>;

        }
        var timeSinceEpoch = getCurrentTime(); 

        //document.write(timeSinceEpoch);

        var heartFailure = <?php echo $res['ytd_cases'];?> ; // this is the total cases since beginning
        var caseToday = <?php echo $res['case_today'];?>;

        function casesAsOfToday(){

            caseToday++;
            document.getElementById('cases_today').innerHTML = 'Cases today ' + caseToday;

        }

        function countFailure() {

            heartFailure++;
            document.getElementById('heart_failure').innerHTML = 'Year to date cases: ' + heartFailure;
        }
        setInterval('countFailure()', 1700);
        setInterval('casesAsOfToday()',1700);

    </script>

</head>

<body>

    <div id="heart_failure"></div>
    <br/>

    <div id="cases_today"></div>


</body>
</html>

that's pretty much it. You can style the integer count by adding CSS. So, this

<div id="heart_failure"></div>

can have class attribute

veedeoo 474 Junior Poster Featured Poster

I really don't know why it has to be on the front-end. if that is the intension of the OP, IMHO , we don't tell the user if something is wrong in the back-end unless it is a user related such as 'we are conducting a maintenance at this time, please come back later'. Giving so much information about your errors can lead to vulnerability exposure.

In fact, when we write an application we always suppressed possible errors e.g. @exec('ffmpeg').

veedeoo 474 Junior Poster Featured Poster

The dude can also test it on his CLI like so,

php /the_main_cron_class.php movies/cool
veedeoo 474 Junior Poster Featured Poster

Here the screenshot to make points much clearer.

c0237142daa6bdf4519d09a30fbed2aa

The PHP extensions on the left are compiled with VC11 for the PHP version 5.6.3, while on the right side are compiled with VC9. Noticed the difference? The different files (e.g eaccelerator, apc, and many other important extension for PHP's functionalities), you can find more information about those extensions here.

One problem that you maybe facing here is to find extension that are in your current PHP versions compiled with VC11.

You just need to experiment and see if it will work. Hoping, that VC9 compiled extensions are no different than the VC11 extensions as far as functionality is concern.

If you are brave enough, try compiling your own PHP flavor using this guide. The guide requires VC12 and Some PHP extensions like ffmpeg, mp4box requires MingGW

veedeoo 474 Junior Poster Featured Poster

is it installed in Program Files or is it somewhere in the root drive e.g. c:/yourWAMP?

Upated:

put this on a new php page

<?php 

    phpinfo(); 
?>

direct your browser to this page..

What is the value of the compiler used in your current PHP? Normally, php 5.x.x are compiled with MSVC9 (Visual C++ 2008).

If your PHP version is compiled with MSVC9, then it is just a matter of replacing the entire PHP directory with the latest PHP compilation.

Although this is possible, I have some reservation if this will work on your case. The reason is that all of the latest PHP versions after 5.4.x are compiled with VC11.

Again, experimentation is not forbidden. YOu may try doing it with the VC11 compilation, but make sure to have a good back-up of your old PHP directory.

WARNING VERY IMPORTANT!
Use only **thread safe **compilation.

WARNING AGAIN!
Make sure to make a back-up of the entire PHP directory, before attempting to replace it with the lates PHP compilation.

veedeoo 474 Junior Poster Featured Poster

Just the thought of having a production site hosted inside the xampp can make me cringed. Uniform server is far better than Xampp in terms of production website security. However, that is not the right way serving websites for the web.

If you are using windows, there is an Oracle VM virtual-box to consider. You can install linux server inside the virtual box and then port the IP address of the virtual box in your windows hosts file and then make the virtual server serve on port 80. Normally, this is on the network configuration page of your modem manufacturer.

By using this kind of configuration, you can have mail service, news feed service, ftp service, apache, nginx, mysql, webmin, and the experience of doing things most web professionals does on a daily basis.

Another alternative is to let your windows apache server ( this will work better if the nginx is located in the window side or host side and then forward to virtual host's apache) receive and forward all requests to the virtual host.

veedeoo 474 Junior Poster Featured Poster

correction! :)

this

<script>
    function jsFunction() {
    var index;
    var text = "<ul>";
    var codes = (show_array());
    for (index = 0; index < codes.length; index++) {
    text += "<li>" + codes[index] + "</li>";
    }
    text += "</ul>";
    document.getElementById("codes").innerHTML = text;
    }
</script>

should read

<script>
    function jsFunction() {
    var index;
    var text = "<ul>";
    var codes = (set_array());
    for (index = 0; index < codes.length; index++) {
    text += "<li>" + codes[index] + "</li>";
    }
    text += "</ul>";
    document.getElementById("codes").innerHTML = text;
    }
</script>
veedeoo 474 Junior Poster Featured Poster

@D,

Luckily, I always keep screenshots on my thumb drive and desktop. Here we go Mr. L.D.A

yes it is a win executable or msi. The application is pretty lightweight. We experimented using a CSS framework like bootstrap.

We used the tideSDK with Titanium SDK. Unlike PHP-GTK, we have more success in developing with tideSDK.

below is the screenshot of a bootsrap framework working as front-end

274c117a456347408e5c34e452f35c67

the screenshot at runtime

ff1163a87aec3fc4f935daf07ec878ba

the executed desktop app using the simple Daniweb API codes as shown

$feed = file_get_contents('https://www.daniweb.com/rss/pull/solved');
$articles = new SimpleXMLElement($feed);

foreach ($articles->channel->item as $article) {
echo '<a href="' . $article->link . '">' . $article->title . '</a><br />';
}

the result

6e983e02f804e5c6a826a741a71f32f9

screenshot of the link destination of the app, once clicked. Screenshot showing the application browsing this thread.

1f0d93124e6661bdf0974de1da981cd0

screenshot of the win32 files

ea8b86b1d6278b5d720ba90eed92d671

The SDK is pretty easy to work on. In fact, they also have an android SDK and other mobile SDKs.

Example of coding in procedural

<script type="text/php">

    function set_array()
    {

       return (array('php','javascript','ruby','python'));

     }

 </script>

we can pass the output of the PHP function above onto the javascript function

<script>

    function jsFunction() {
        var index;
        var text = "<ul>";

        var codes = (show_array());
        for (index = 0; index < codes.length; index++) {
            text += "<li>" + codes[index] + "</li>";
        }
        text += "</ul>";
        document.getElementById("codes").innerHTML = text;
    }

</script>

we deliver …

veedeoo 474 Junior Poster Featured Poster

I am not sure if this is exactly what you are looking for, but in PHP it is called transaction. The mysql ENGINE directives must be set to innodb.

Normally, if you are using PHP MVC frameworks like fuel PHP, laravel, and even CI (lower level), these frameworks are pre-packaged with database library that can easily handle transactions.

The idea is pretty similar to the ADODB objects. Similar to other programming languages, PHP trasactions can be roll-back. Meaning, if later on we don't want the latest modification on our database, we can roll it back to the previous state e.g.

$this->db->trans_begin();

$this->db->query('Your_First_Query.....');
$this->db->query('Maybe_a_Second_Query..');
$this->db->query('And_yet_another_a_third_Query...');

if ($this->db->trans_status() === FALSE)
{
    $this->db->trans_rollback();
}
else
{
    $this->db->trans_commit();
}

if this

$this->db->trans_status()

evaluates to FALSE, then we can roll-back. Otherwise, we commit to finalize the transaction.

This topic is pretty huge and it requires practice and full understanding of ORM. At the moment, I really don't know what to recommend as far as tutorial is concern.

You can read more about it here and here.

veedeoo 474 Junior Poster Featured Poster

here is a good tutorial on how it can be done without relying too much on session and cookie. If you need help in converting it to mysqli or PDO, please let us know.

veedeoo 474 Junior Poster Featured Poster

current time minus the time of the event. If the difference between these two is greater than or equal 10 minutes, you must set your user free.

veedeoo 474 Junior Poster Featured Poster

the error says it all mysql_real_escape_string() . page number is not a string, it is an integer.

So, your validation should focus on is_numeric and FILTER_SANITIZE_NUMBER_INT. Make sure to remove ., +, - before evaluating which page should be deliver to your user.

veedeoo 474 Junior Poster Featured Poster

This is a pretty simple ethical hacking for testing purposes only. This may work or may not work.. just bringing the points accross.

for example if you don't sanitize and validate this

media.php?hal=detail&id=1

and if I visited your site and I want to see all of your media. I would put this on my browser

media.php?hal=detail&id=10000000

Hoping that you did not turn off your error reporting. I would probably get an error saying

media_id is not valid or not found.

now, I know one of the column of your database. With this given info. thanks to your server, I can change the url above to

media.php?hal=detail&id=''ORmedia_id REGEXP '^[0-9]'

if we use that on our query, it will spit out all of the media with media_id matching anything from 0 to 9 ..

veedeoo 474 Junior Poster Featured Poster

Warning: Cannot modify header information - headers already sent by (output started at /home/blahblahblah.php on line 24"

try adding

exit;

after the header location..

Another alternative:

if you want to redirect after the alert, then redirect can be wrap with <script> </script> as in

echo "<script type=\"text/javascript\">alert('item succesfully added');
        window.location='your_page.php';
    </script>";

that's all I think of right now. PHP will not know if javascript already alerted the user.

To redirect using the PHP redirect function a simple javascript function is needed to call a PHP function,

veedeoo 474 Junior Poster Featured Poster

validate, sanitize, check for the referrer.

veedeoo 474 Junior Poster Featured Poster

do as suggested above and then maybe you want to experiment something like this...

if you know where to find httpd.conf on your server, then you can add .phtml into your directory index directives like so

DirectoryIndex index.php index.phtml index.html index.htm index.cgi

by default php can parse .inc, .tpl, php3 and phtml. I am wondering why your server couldn't do the .phtml file?

veedeoo 474 Junior Poster Featured Poster

You have arrived. Welcome to Daniweb. Your project is looking good and good luck to you.

veedeoo 474 Junior Poster Featured Poster

hi, welcome to Daniweb.

veedeoo 474 Junior Poster Featured Poster

I think you have arrived to the right place. About your opening question, I am not sure what will work for you and what will not. However, when I was a lot younger than today, I wanted to learn MVC pretty bad. In fact, I was losing some pretty good sleep just by thinking about it.

One day, it just came to me and I fully understand the concept. It was an awakening to me... the attached image below is the representation of my understanding about the MVC design pattern implemented as framework.

a54990cf45de9481bf5db0f2d9242c9f

Lorele commented: I think I noticed this image and extended response late, perhaps due to editing, but it was helpful! +0
veedeoo 474 Junior Poster Featured Poster

I truly admire people who can give updates when they found the solution.

Thanks.