baig772 19 Web Application Architect

I am using passport in laravel for authenticating my users in APIs. I am able to authenticate different types of users from different tables and generating different token for them but the routes are not protected. For example.
A user can access the routes like this

Route::group(['middleware'  =>  'auth:api'], function () {
    Route::group(['prefix'  =>  'v1'], function () {
        Route::get('get-seller-list','API\v1\SellersController@index');
    });
});

and A doctor can access the routes like

Route::group(['middleware'  =>  'auth:sellers'], function () {
    Route::group(['prefix'  =>  'v1'], function () {
    Route::get('get-seller-detail','API\v1\TestController@getDetails');
    });
});

but this middleware check doesn't seem to be working as I can access all the routes for sellers even if I have passed the token generated for api in Bearer header.

My config/auth.php looks like

'guards' => [
        'user' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'seller' => [
            'driver' => 'passport',
            'provider' => 'sellers',
        ],

        'admin' => [
            'driver' => 'session',
            'provider' => 'admins',
        ],

        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'passport',
            'provider' => 'users',
        ],
    ],
baig772 19 Web Application Architect

I am trying to implement multi authentication in laravel5.2. I am following this article

My Auth.php

<?php

return [
 'multi' => array(
   'user' => array(
     'driver' => 'eloquent',
     'model' => 'App\User',
     'table' => 'users',
   ),
   'admin' => array(
     'driver' => 'database',
     'model' => 'App\Admin',
     'table' => 'tbl_admin_user',
   )
 ),
 'password' => [
 'email' => 'emails.password',
 'table' => 'password_resets',
 'expire' => 60,
 ],
];

My App.php

'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        //Illuminate\Auth\AuthServiceProvider::class,
        Ollieread\Multiauth\MultiauthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,

    ],

    /*
    |--------------------------------------------------------------------------
    | Class Aliases
    |--------------------------------------------------------------------------
    |
    | This array of class aliases will be registered when this application
    | is started. However, feel free to register as many as you wish as
    | the aliases are "lazy" loaded so they don't hinder performance.
    |
    */

    'aliases' => [

        'App' => Illuminate\Support\Facades\App::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,
        'Auth' => Illuminate\Support\Facades\Auth::class,
        'Blade' => Illuminate\Support\Facades\Blade::class,
        'Cache' => Illuminate\Support\Facades\Cache::class,
        'Config' => Illuminate\Support\Facades\Config::class,
        'Cookie' => Illuminate\Support\Facades\Cookie::class,
        'Crypt' => Illuminate\Support\Facades\Crypt::class,
        'DB' => Illuminate\Support\Facades\DB::class,
        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
        'Event' => Illuminate\Support\Facades\Event::class,
        'File' => Illuminate\Support\Facades\File::class,
        'Gate' => Illuminate\Support\Facades\Gate::class,
        'Hash' => Illuminate\Support\Facades\Hash::class,
        'Lang' => Illuminate\Support\Facades\Lang::class,
        'Log' => Illuminate\Support\Facades\Log::class,
        'Mail' => Illuminate\Support\Facades\Mail::class,
        'Password' => Illuminate\Support\Facades\Password::class,
        'Queue' => Illuminate\Support\Facades\Queue::class,
        'Redirect' => Illuminate\Support\Facades\Redirect::class,
        'Redis' => Illuminate\Support\Facades\Redis::class,
        'Request' => Illuminate\Support\Facades\Request::class,
        'Response' => Illuminate\Support\Facades\Response::class,
        'Route' => Illuminate\Support\Facades\Route::class,
        'Schema' => Illuminate\Support\Facades\Schema::class,
        'Session' => Illuminate\Support\Facades\Session::class,
        'Storage' => Illuminate\Support\Facades\Storage::class,
        'URL' => Illuminate\Support\Facades\URL::class,
        'Validator' => Illuminate\Support\Facades\Validator::class,
        'View' => Illuminate\Support\Facades\View::class, …
baig772 19 Web Application Architect

I have a string like
string(8234) "<style>.{ margin-bottom:10px; float:left; display: inline-block; width:56%; text-align:left; padding-right:20px; padding-left:20px; } . > p { display: table-cell; height: 150px; vertical-align: middle; }..................</style>.................
I want to remove <style> tag and all its contents.
I have tried

$description = $product_info['description']; // the string with style tag
$text = preg_replace('/<\s*style.+?<\s*\/\s*style.*?>/si', ' ', $description );
echo $text;

but it shows the same string without removing <style> tag.
I have also tried to replace only <style> tag by doing

$text    = str_replace("<style>", "", $description);

but this also doesn't work at all. I am seeing the same string again and again. I have also tried it with DOMParser

 $doc =   new DOMDocument();
 $doc->loadHTML($description);
 $xpath = new DOMXPath($doc);
 foreach ($xpath->query('//style') as $node) {
    $node->parentNode->removeChild($node);
 }
 $text    =    $doc->saveHTML();

but in all cases, output is the same with <style> and its contents

baig772 19 Web Application Architect

I have a div with width: 200px and I am adding text in it dynamically, I want the text to fit in this div but the text is getting out. I have tried to change the font size on character count but it does not work in all cases, like if string contains character with more width like W or M, the text goes out of the div.
Below is my code

if(cs >= 1 && cs <= 4) {
 if(this.engravingFontCaseSenstiveOptions(cText) == "Lower")
    {
        $('#overlay_image_text').css({'margin-top':'-162px'});
        $('#overlay_image_text').css({'font-size':60+'px'});
    }else if(this.engravingFontCaseSenstiveOptions(cText) == "Upper")
    {
        $('#overlay_image_text').css({'margin-top':'-154px'});
        $('#overlay_image_text').css({'font-size':48+'px'});
        $('#overlay_image_text').css({'margin-left':'0px'});
    }else
    {
        $('#overlay_image_text').css({'margin-top':'-162px'});
        $('#overlay_image_text').css({'font-size':60+'px'});
        $('#overlay_image_text').css({'margin-left':'0px'});
    }
 }
 else if(cs == 5) {
   if(this.engravingFontCaseSenstiveOptions(cText) == "Lower")
    {
        $('#overlay_image_text').css({'margin-top':'-152px'});
        $('#overlay_image_text').css({'font-size':54+'px'});
        $('#overlay_image_text').css({'margin-left':'0px'});
    }else if(this.engravingFontCaseSenstiveOptions(cText) == "Upper")
    {
        $('#overlay_image_text').css({'margin-top':'-143px'});
        $('#overlay_image_text').css({'font-size':45+'px'});
        $('#overlay_image_text').css({'margin-left':'0px'});
    }else
    {
        $('#overlay_image_text').css({'margin-top':'-143px'});
        $('#overlay_image_text').css({'font-size':45+'px'});
        $('#overlay_image_text').css({'margin-left':'0px'});
    }
}
baig772 19 Web Application Architect

Problem I need an jax pagination in YII, The problems are

  • its not showing the required results for the first time. ie. it is showing the complete result
  • When clicked on more, it again shows the complete result below that section as it is

What Needed

  • i need to show, say 5 records for the first time
  • load the remaining results (5 rows) once clicked on more and so on
    My Wordkout

ControllerAction

public function actionShopStoresByCategory($storecategory, $affusername = NULL) {

        $this->ticker_news = NewsTicker::model()->getTickerNews();
        if (!empty($affusername))
            $this->VarifyUser($affusername);
            $this->layout = "layout_home";
        $model = new Stores();
        $criteria = new CDbCriteria;
        $total = count($model->getAllStoresByCategory($storecategory));
        $pages = new CPagination($total);
        $pages->pageSize = 5;
        $pages->applyLimit($criteria);
        $posts = $model->getAllStoresByCategory($storecategory);
        $data['stores_cat_data'] = $posts;
        $data['store_id'] = $storecategory;
        $data['store_cat_name'] = Storescat::model()->findByPk($storecategory);

        $this->render('allstoresbycategory', array('model' => $model, 'data' => $data,'pages' => $pages,));
    }

Moedl

public function getAllStoresByCategory($category_id) {
    $connection = Yii::app()->db;
    if ($category_id == "22") {
    $sql = "SELECT DISTINCT s.title,s.cCommisions_percentage, s.url, s.id, s.logo, s.publisher_id, cp.subid FROM stores s LEFT JOIN crawling_publisher cp ON s.publisher_id=cp.id WHERE 1 ORDER BY s.title ASC";
    }
else {
        $sql = 'SELECT s.title, s.url, s.id, s.logo, s.cCommisions_percentage, s.publisher_id, sc.store_category_id, cp.subid from stores s
            LEFT JOIN store_categories sc
            ON s.id=sc.store_id
            LEFT JOIN crawling_publisher cp
            ON s.publisher_id=cp.id
            where sc.store_category_id = \'' . $category_id . '\'
                                                            ORDER BY s.title ASC';
    }
    $command = $connection->createCommand($sql);

    $data = $command->queryAll();

    if ($data) {
        return $data;
    } else {
        return false;
    }
}

View

<?php
 if ($data['store_id'] != 22) {
 ?>
 <div class="featuredcompaniesWrapp">
 <h1>Shop <?php echo $data['store_cat_name']->attributes['title']; ?> by Stores</h1>
 <!--featuredcompaniesRow--> …
baig772 19 Web Application Architect

I have a form for editing a user record. Its updates the record for the first time but when i press the update button again, it shows me an empty screen and it unsets the picture as well. I cannot figure out what I am doign wrong Below is my code

public function actionEditProfile($affusername = NULL) {

        $this->layout = 'layout_home';

        if ($this->VarifyUser($affusername) && Yii::app()->user->id) {

            $model = new Users('edit'); //apply rules if user comes directly to signup page
            // uncomment the following code to enable ajax-based validation
            if (isset($_POST['ajax']) && $_POST['ajax'] === 'editprofile-form') {
                 CActiveForm::validate($model);
                Yii::app()->end();
            }

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


                $the_image = CUploadedFile::getInstance($model, 'image');
                if (is_object($the_image) && get_class($the_image) === 'CUploadedFile') {

                    $model->image = $the_image;
                }


                if (is_object($the_image)) {

                    $file_name = Yii::app()->user->id . '.' . $model->image->extensionName;

                    $move    =   $model->image->saveAs(Yii::getPathOfAlias('webroot') . '/themes/myproject/images/users/' . $file_name);

                    $_POST['Users']['image'] = $file_name;
                }


                $model->attributes = $_POST['Users'];


                if ($model->validate()) {

                    // form inputs are valid, do something here
                    if ($model->updateByPk(Yii::app()->user->id, $_POST['Users'])) {
                        //$this->setFlashSuccess("Unable to register user, please try again");
                        $this->setFlashSuccess('Updated successfully, now redirecting.');
                        //$this->redirect($this->base_url);
                    } else {
                        $this->setFlashError("Unable to update user, please try again");
                        return false;
                    }
                } else {
                    print_r($model->getErrors());
                    echo 'validation  fail';
                    exit;
                }
            }

            $user_data = Users::model()->getUsersByUserName($affusername); //getting user information
            //print_r($user_data);
            //$model=new Users('nonfb-create'); //apply rules if user comes directly to signup page
            $this->render('editprofile', array('model' => $model, 'data' => $user_data,));
        } else {
            $this->redirect($this->base_url);
        }
    }

My view is

<div class="adminform_wrapp">
                <?php
                $form = $this->beginWidget('CActiveForm', array(
                    'id' => 'editprofile-form',
                    'enableAjaxValidation' => false,
                    'clientOptions' => array(
                        'validateOnSubmit' => true,
                    ),
                    'enableClientValidation' => true,
                    'focus' => array($model, …
baig772 19 Web Application Architect

Yes exactly @dani you got me right :)

baig772 19 Web Application Architect

But we still need to look into your code. May be there are some server settings isseu or some thing else

baig772 19 Web Application Architect

For pagination, this will help you Pagination

baig772 19 Web Application Architect

Paste your code here and let the community look whats wrong with that.
keep that in mind that "you cannot send emails from you local server unless and untill you have configured mercury"

baig772 19 Web Application Architect

2 questions in 1 question :p
There is no hard and fast rule for using the specific framework. But in my opinion, if you are a starter and you don't have experience in PHP, then you must start with Code Igniter
Reasons:

  • Strong Community
  • Extendable
  • Ease of use
  • Requires no confguration
    But still there is no hard and fast rule
    Go ahead :)
baig772 19 Web Application Architect

Hi all
I am making a website. I want to use linkshare on my website so that all the publishers registered with linkshare are listed on my website.
Any suggestions?
Link Share

baig772 19 Web Application Architect

Lolz. Yes I posted at the same time as i was in rush. Well it is solved now
Thanks :)

baig772 19 Web Application Architect

Hi
Any one ever wrked on live helper chat? This
This is following template structure may be symfony or smarty and I am looking to change some form labels, but cannot figure out where to chage?
Thanks in advance for help

baig772 19 Web Application Architect

What code should I show you? I know that we cannot create the page turn effect in php. I cannot use jQuery or other javascript techniques because this applies only on image but I have a file. This module is available for Joomla Click Here
I just want to know the functionality of this module so that I can create my own (if not available for custom php). Is there any way to convert pdf file pages into images?

baig772 19 Web Application Architect

Hi all
I have a website about magazines and I want to upload the pdf file into it and create a flipping book effect for that uploaded file. I have seen many softwares but he problem is

  • I want to integrate this functionality in my website
  • I am using custom Php, (I have seen module and components for Joomla and Magento)
    Thanks in advance
baig772 19 Web Application Architect

Thanks for the quick reply @Pritesh, but it did not work. It moved the magnifying glass image out of the search box (small in width). Nothing changed in with the search box (with greater width)

baig772 19 Web Application Architect

I have a search form with only one text field. The problem is that the width of that text field is not same. the style is

form#index-table-form input[type="text"] {
                            width: 106px;
                            height: 24px;
                            position: absolute;
                            outline: none;
                            right: 0;
                            top: 6px;
                            border: 1px solid #3772af;
                            padding-left: 6px;
                            padding-right: 24px;
                            font-family: Arial, Helvetica, sans-serif;
                            font-size: 14px;
                            font-weight: bold;
                            color: #0c4784;
                            background: white;
                            -moz-box-shadow: 0px 1px 2px 0px #737373;
                            -webkit-box-shadow: 0px 1px 2px 0px #737373;
                            box-shadow: 0px 1px 2px 0px #737373;
                            behavior: url("js/PIE.htc");
                        }

But the width and height is not the same on different pages. I cannot use the inline style or important to set the dimensions.
searchbox2
searchbox1

see the size of both text boxes is not same, though its a very minor difference

baig772 19 Web Application Architect

Please share what you get when you do

ehco "<pre>;
print_r($_POST); 
echo "</pre>";"
baig772 19 Web Application Architect

I am very new to wordpress. I am hivaing a small problem in my site. I am using a custom template for the home page, I have category filters on top, on mouseover it shows the total no. of models in that specific category. Well the problem is, I have done the pagination as asked in my previous qiestion but this category wise filter does not work with pagination. For example you bring the mouse over "0-12 Boys", it will show you 3 but when you click on that, it will bring only 1 (other 2 are on the next page)

Here is my site http://ibay.co.za/faces/

Any help will be appreciated. Please let me know if I have to show you some of my theme codes etc. etc.

Thanks :)

baig772 19 Web Application Architect

@blocblue: I am using a custom theme, named as Ying_and_yang of onion eye. Now there is pagination but its returning the same results on each page :(

baig772 19 Web Application Architect

I am using a plugin wp_paginate

baig772 19 Web Application Architect

Its been alot of mess to make the pagination in wordpress :(
I have the pagination, but it renders the same page
template file is

?php get_header(); ?>

    <?php    
        global $my_query;
global $paged;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$temp = $my_query;
$my_query = null;

$args  = array( 
    'post_type' => 'portfolio', 
    'paged' => $paged, 
    'posts_per_page' => 16, 
);
$my_query = new WP_Query( array( 'posts_per_page' => '-1', 'post_type' => 'portfolio' ) );
//do some work

//calling paginate
wp_paginate();
$wp_query = null; 
$wp_query = $temp;
?>

paginate function is

function paginate($args = false) {

                    if ($this->type === 'comments' && !get_option('page_comments'))
                return;

            $r = wp_parse_args($args, $this->options);
            extract($r, EXTR_SKIP);

            if (!isset($page) && !isset($pages)) {


                            global $wp_query;
                            $wp_query->query('post_type=portfolio&posts_per_page=16&paged=' . $paged);
                if ($this->type === 'posts') {
                    $page = get_query_var('paged');
                    $posts_per_page = intval(get_query_var('posts_per_page'));
                    $pages = intval(ceil($wp_query->found_posts / $posts_per_page));
                }
                else {
                    $page = get_query_var('cpage');
                    $comments_per_page = get_option('comments_per_page');
                    $pages = get_comment_pages_count();
                }
                $page = !empty($page) ? intval($page) : 1;
            }

            $prevlink = ($this->type === 'posts')
                ? esc_url(get_pagenum_link($page - 1))
                : get_comments_pagenum_link($page - 1);
            $nextlink = ($this->type === 'posts')
                ? esc_url(get_pagenum_link($page + 1))
                : get_comments_pagenum_link($page + 1);

            $output = stripslashes($before);
            if ($pages > 1) {
                $output .= sprintf('<ol class="wp-paginate%s">', ($this->type === 'posts') ? '' : ' wp-paginate-comments');
                $output .= sprintf('<li><span class="title">%s</span></li>', stripslashes($title));
                $ellipsis = "<li><span class='gap'>...</span></li>";

                if ($page > 1 && !empty($previouspage)) {
                    $output .= sprintf('<li><a href="%s" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
                }

                $min_links = $range * 2 + 1;
                $block_min = min($page - $range, $pages - $min_links);
                $block_high = max($page + $range, $min_links);
                $left_gap = (($block_min …
baig772 19 Web Application Architect

why you are having same conditions in your else if's ??
It can be done by nested ifs. do another check in your ifs i.e. from which currency to what currency??

baig772 19 Web Application Architect

i am applying the highlighting on all over the text in which html tags are also there

baig772 19 Web Application Architect

have you created the object properly? i mean what is $dbc

baig772 19 Web Application Architect

I have a search form, in which a user enters a keyword and it displays the results with the keyword in description as highlighted text, for highlighting, i have used another class on that keyword. problem is that, if there is a keyword in some hyperlink or in some <img> tag, it also applies that class there that causes the image load failure and links are not working.

That is how i am fetching my results and highlighting them if there is any keyword.

<?php 
if($_GET['key']){ 
        $key = $_REQUEST['key'];
$sql = "select * from tbl_feed WHERE title LIKE '%$key%' OR description like '%$key%'";
$rs  = $dbFun->selectMultiRecords($sql);
for($j=0;$j<count($rs);$j++){
        $title= mb_convert_encoding($rs[$j]['title'], "iso-8859-1","auto");
        $desc   = mb_convert_encoding($rs[$j]['description'],"iso-8859-1","auto");
        ?>
        <?php
      for($i = 0; $i < sizeof($arrKeywords); $i++){
                        $title = str_ireplace($arrKeywords[$i], "<font class=\"highlight\">" . $arrKeywords[$i] . "</font>", $title);
                        $desc = str_ireplace($arrKeywords[$i], "<font class=\"highlight\">" . $arrKeywords[$i] . "</font>", $desc);
                    }
      ?>

<a href="<?=$rs[$j]['link']?>" target="_blank"><strong><?=$title?></strong></a><BR />
<?=$rs[$j]['pubdate']?><BR /><BR />
<?=$desc?><BR /><BR /><BR />
<? }
}

is there any way that it skips the html tags from replacing?

baig772 19 Web Application Architect

LPS: as you said, this is very easy to do but if I do this task in your way,

mysql_query();

will be executed at least 4 times which may cause some performance problem and its also not a good practice to send connections to mysql every time?
I have read that in case of huge data, this practice can also lead to crash :( so i will not recomend any body to do that practice.
Hope i am clear now? :)

baig772 19 Web Application Architect

I have the following table structure of my db:

  • tbl_project

  • tbl_employee

  • tbl_deliverable

  • user_to_deliverable
    as tbl_prjct and tbl_deliverable has 1-many relation, tbl_employee and tbl_deliverable have many-many relation so they are splited into user_to_deliverable table

All i want is that a query to show project_name(from tbl_project), project's deliverables (from tbl_deliverable) and emloyee name to which that specific deliverable is assigned to.

Can i get help with this?

baig772 19 Web Application Architect

you can use the same as admin, you just have to check if it is commin gfrom admin, status will be 1 and if its from user, status will be 0

baig772 19 Web Application Architect

if the user can enter the article, bydefault set its article status as 0 and then let the admin to view all the articles from where he csn change the status and where you have to show the articles, you can select the articles like
select * from article where status = 1

baig772 19 Web Application Architect

We can host a wordpress blog on windows server it must have php and mysql installed in it. Or you can use some packages like xampp or wamp

baig772 19 Web Application Architect

in any database, if primary key is once deleted, it can never be used again. To reset the primary key, you have to TRUNCATE your table which will result in loss of all the data. So i will not suggest you to reset the table

baig772 19 Web Application Architect

the probelm was because of short tags
i changed

<? to <?php in db.php and it was working

baig772 19 Web Application Architect

i am having a problem, i downloaded the project from dev to my local, though it is running fine on dev but on local, it says me the following error Fatal error: Class 'DB' not found in F:\xampp\htdocs\timesheet\index.php on line 9 my index.php is

    <?php
        session_start();
        error_reporting(1);
        include_once('classes/db.php'); 
        include_once('classes/functions.php');  

    //==========================================
        $dbFun=new DB();
        $dbFun->ConnectToDb();
        $incFun= new Functions();
    //==========================================
        if(isset($_GET['file'])){
             $file = $_GET['file'];
        }
        else if(isset($_POST['file'])){
             $file = $_POST['file'];
        }
        else{
               $file = "login.php";
        }  
    ?>
    <html><head>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <title>::Administration::</title>
    <? if(($file != "login.php") && ($_SESSION['sid'] != "")){?>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script src="js/CalendarPopup.js" type="text/javascript" language="JavaScript"></script>
    <script type="text/javascript" src="js/sortable.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script>
    </head>
    <body>

    <table width="100%" height="90%" border="0"  align="center" cellpadding="0" cellspacing="0" bordercolor="#1F5F69">
    <tr>
      <td height="36" colspan="3" valign="top">
      <table width="100%" height="150" border="0" cellpadding="0" cellspacing="0" style=" background:url(images/topbg.jpg); background-repeat: repeat-x;">

          <tr>

            <td width="30%" rowspan="2" align="left" valign="top"><img src="images/logo_quality_web_programmer.jpg" alt="Miami Truck Guide" width="351" height="151" /></td>

            <td width="70%" height="76" align="right" valign="top"><table width="500" border="0">
              <tr>
                <td align="right" style="color:#FFFFFF;">Welcome <? echo $_SESSION['sid'];?>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="?file=logout.php" style="color:#FFFFFF;">Logout</a>&nbsp;&nbsp;|&nbsp;&nbsp;Search</td>
                <td width="23">&nbsp;</td>
              </tr>

              <tr>
                <td align="right" valign="top"><span id="top-search"><form id="form1" name="form1" method="post" action=""><input name="search" type="text" id="search" />              
                <input type="image" src="images/search.png" name="Submit" value="Submit" /></form></span></td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
    </tr>

    <tr>

        <td width="213" rowspan="2" valign="top" style=" background:url(images/leftbg.jpg); background-repeat: repeat-x;">
        <? if($_SESSION['type'] == "Administrator"){
        include("admin_nav.php");
        } else{
        include("emp_nav.php");
        }?></td>
        <td width="11" rowspan="2" valign="top">&nbsp;</td>
        <td width="990" height="10" valign="top"></td>
    </tr>
    <tr>
      <td valign="top"><? include($file);?></td>
    </tr>
    </table>
    <? } else { include("login.php");}?>

    <script type="text/javascript">

    $(document).ready(function(){

        //$('#pid').click(function(){
        $("select").change(function(){
        //alert("asma");
        var puid = $("#pid").val();
        document.getElementById(puid).style.display = 'block';
        });

        $("#button").click(function(){
        var frm = document.getElementById("leftform");
            frm.submit();
        });
    });

    </script>
    </body></html>` …
baig772 19 Web Application Architect

For uploading, there are 3 basic steps

  1. Make your form to carry data like pictures and files to other page by <enc-type=multipart/formdata>
  2. Check what you are getting when you post the form
  3. Move the file to your respective directory by move_uploaded_file()

I suggest you to make the directories by mkdir() function and then move the file to that directory and store the name or path in the db

While viewing, you have to use some lighbox or many jquery image sliders are available over the internet

baig772 19 Web Application Architect

Hi all,
I want to implement a page flip effect on y uploaded pdf file. like Click Here. I am uploading a pdf file and while viewing it, i want a page flip effect in it. Any help will be appriciated

baig772 19 Web Application Architect

Yes that was a UTF-8 encoding probelm. I was using Iso-8859-1. Corrected it and now its working fine. Thanks to all :)

baig772 19 Web Application Architect

i have an alert box which i want to show some icelandic text but its not showing it

<script>
function check() {
alert("Þú verður að vera skráð/ur inn til þess að senda skilaboð");
}
</script>

it is showing the alert box but the text is messed up :(

Þú verður að vera skráð/ur inn til þess að senda skilaboð

any help please :(

baig772 19 Web Application Architect

Also share the error you are facing

baig772 19 Web Application Architect

Share your error also

baig772 19 Web Application Architect

can you please share the code that saves the state? I am in a great trouble because of this :(

baig772 19 Web Application Architect

I am running an application in which i am running an audio when it is clicked on image, while audio is being played and i changed the mode from landscape to portrait or from portrait to landscape and click on image, it plays another audio clip i.e. 2 audios are being played now. But this issue does not occur by clicking the images in the same mode. Is there any way to stop the previous activity when mode is changed?

baig772 19 Web Application Architect

It was some root permission issue. I downloaded it in Downloads and moved it to /opt/lampp/htdocs. Now working fine :)

baig772 19 Web Application Architect

Hi all,
i am new to ubuntu.
I am using fire ftp for downloading my project locally in ubuntu but when i click on download, it says "Failed to create directory locally".
Is it some root permission issue? if yes, then how i can download my project?

baig772 19 Web Application Architect

try including the file by giving absolute path and share please

baig772 19 Web Application Architect

Its not updating or inserting in Likes table? manually run your queries by echoing it and see what you get?

baig772 19 Web Application Architect

Is it not working? if so then what error you are facing?

baig772 19 Web Application Architect

Its working fine but if the problem still exists, best option is to use he backup files

baig772 19 Web Application Architect

Share the confirm box code and in remove_user.php, type

echo "<pre>";
print_r($_REQUEST);
echo "</pre>";

and share it