Jump to content

ali_254

Members
  • Posts

    97
  • Joined

  • Last visited

Posts posted by ali_254

  1. I want to use soap in codeigniter 4.

    i download file "nusoap.php" And  put it next to the project.

     

    require_once(APPPATH.'Controllers\Payment\lib\nusoap.php');
    $soapclient = new soapclient('https://verify.sep.ir/Payments/ReferencePayment.asmx?WSDL');
    

     

    when run project , I receive error  'soapclient not found'

    Please help me, how can  use soap in codeigniter 4.thanks

  2. hi...

    i install xampp and composer in Ubuntu and i want install laravel with this code:

    composer create-project laravel/laravel example-app

    but i Received this error:

    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - phpunit/phpunit[9.3.3, ..., 9.5.x-dev] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
        - Root composer.json requires phpunit/phpunit ^9.3.3 -> satisfiable by phpunit/phpunit[9.3.3, ..., 9.5.x-dev].
    
    To enable extensions, verify that they are enabled in your .ini files:
        - /etc/php/7.4/cli/php.ini
        - /etc/php/7.4/cli/conf.d/10-opcache.ini
        - /etc/php/7.4/cli/conf.d/10-pdo.ini
        - /etc/php/7.4/cli/conf.d/20-calendar.ini
        - /etc/php/7.4/cli/conf.d/20-ctype.ini
        - /etc/php/7.4/cli/conf.d/20-exif.ini
        - /etc/php/7.4/cli/conf.d/20-ffi.ini
        - /etc/php/7.4/cli/conf.d/20-fileinfo.ini
        - /etc/php/7.4/cli/conf.d/20-ftp.ini
        - /etc/php/7.4/cli/conf.d/20-gettext.ini
        - /etc/php/7.4/cli/conf.d/20-iconv.ini
        - /etc/php/7.4/cli/conf.d/20-json.ini
        - /etc/php/7.4/cli/conf.d/20-mbstring.ini
        - /etc/php/7.4/cli/conf.d/20-phar.ini
        - /etc/php/7.4/cli/conf.d/20-posix.ini
        - /etc/php/7.4/cli/conf.d/20-readline.ini
        - /etc/php/7.4/cli/conf.d/20-shmop.ini
        - /etc/php/7.4/cli/conf.d/20-sockets.ini
        - /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
        - /etc/php/7.4/cli/conf.d/20-sysvsem.ini
        - /etc/php/7.4/cli/conf.d/20-sysvshm.ini
        - /etc/php/7.4/cli/conf.d/20-tokenizer.ini
    You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

    please guide me.

    my php version is 7.4.16

  3. 53 minutes ago, requinix said:

    So you want a query like

    UPDATE posts SET count = count + 1 WHERE id = $id

     

    ok thanks , but this procedure use in 'Pure PHP' ! .

    i want update database in laravel framework and this Command Will not work!

    i use from query builder in laravel

  4. ok thanks....

    I want to get the number of views of an posts(Articles).

    I created a field in the posts table, I want to add a value to the field every time the code is executed.

    As a result, I have to update the value of a field , By maintaining the previous value that exists in the database.

     

    i want update a field , By maintaining the previous value

    DB::table('posts')->where('id' , $id)->update($data);

    view.jpg

  5. ok , thanks....

    in MSDN web docs , Posted:

    Quote

    This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

     

    So I can not use this method?

  6. I found the solution.

    for display the answer of the request in file blade.php , we can use this cod:

    controller

        public function GetSubCategory(){
    
            return response()->json(['success' => 'ok']);
    
    
        }

     

    blade.php:

    <span id="test"></span>
    Document.getElementById('test').innerText=response.success

     

  7. i send Answer the request ajax to file blade.php :

        public function GetSubCategory($category_id){
    $sub="test";
            return response()->json($sub);
    
    
        }

    Now I want to display the answer of the request.

    How can I display it? (in file blade.php)

    i want display variable "$sub" in file blade.php

     

  8. hi . i use from this code for send request Ajax in laravel:

    
            function loadDoc() {
                var xhttp = new XMLHttpRequest();
                xhttp.onreadystatechange = function() {
                    if (this.readyState == 4 && this.status == 200) {
                        // document.getElementById("demo").innerHTML = this.responseText;
    
                        console.log(this);
    
    
                    }
                };
                xhttp.open("GET", "/get/subcategory/", true);
                xhttp.send();
            }
        </script>

     

    route:

    Route::get('/get/subcategory/{category_id}',[PostController::class,'GetSubCategory']);

     

    controller:

        public function GetSubCategory($category_id){
    $sub="test";
            return response()->json($sub);
    
    
        }

     

    for receive request ajax in file blade.php , What command should I use? Thanks

  9. 4 hours ago, maxxd said:

    From the Laravel documentation:

    $flight->name = 'Paris to London';
    $flight->save();

    From your code:

     $data->image=$request->image;
     $data->save;

    Do you see the difference?

     

    oh !!

    I Dont Use "()" !

    The problem was solved! Thanks

     

  10. i use "save" for Update Fields in "Users" Table

     

    thanks . OK...I will explain complete...

     

    i use form Authentication system in laravel (Laravel Jetstream). when i add this package in laravel project , add A number migrations in project...

    i want Edit Table "Users"  in this package...so i add How many Field in this thable: (In Previous article Sent Photo from This Table)

    mobile
    address
    gender
    image

    So ,  I decided Update "Users" Table With New Fields. For Update I use from This Syntax:

    https://laravel.com/docs/8.x/eloquent#updates

     

     

     

     

     

  11. 31 minutes ago, requinix said:

    :psychic:

    You know your application and framework (looks like Laravel) better than us so it's not like we can instantly tell you what table and/or column(s) you have to update.

    If there's a "last logged in" timestamp on the user table then update that. Otherwise...

     

    i want update one record of table in mysql....but my data ,  dont update and dont receive any Error message.

    error.thumb.jpg.510feb25b0e38a66b568a399d2d4afb1.jpg

     $data=User::find(Auth::user()->id);
    
            //echo $date;
            $data->gender=$request->gender;
            $data->name=$request->username;
            $data->mobile=$request->mobile;
            $data->email=$request->email;
            $data->address=$request->address;
            $data->image=$request->image;
            $data->save;
            return redirect()->route('profile.view')->with('success',' User Updated successfuly');

    code:

     

    I used this code for update , Have a Problem? thanks

  12. hi,i use Authentication system and want Update record of User is" loggen in" .i use this code

     $data=User::find(Auth::user()->id);
    
            //echo $date;
            $data->gender=$request->gender;
            $data->name=$request->username;
            $data->mobile=$request->mobile;
            $data->email=$request->email;
            $data->address=$request->address;
            $data->image=$request->image;
            $data->save;
            return redirect()->route('profile.view')->with('success',' User Updated successfuly');

    but dont update this record and dont receive any Error. please guide me

  13. hi , i install "Laravel Jetstream" . this package insert many file in project...

     

    for example add this files:

    login.blade.php
    
    register.blade.php

     

    in login.blade.php , This code exists by default:

    <form method="POST" action="{{ route('login') }}">

     

    but , in file web.php , i dont find this route,  i only found this code:

    Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
        return view('dashboard',compact('users'));
    })->name('dashboard');

     

    "{{ route('login') }}" , Where does it refer?

  14. 11 hours ago, requinix said:

    But something is trying to use GET. You do not support it, which is why there is an error, but something is trying.

    The error message. How did you get it to happen? What did you do to see it?

    i use from login system in laravel , so , when login to system , redirect to "home page":

    http://127.0.0.1:8000/home

     

    when in taskbar type this address , program work with success.

    http://127.0.0.1:8000/test

     

    but , when type this address: receive Error

    http://127.0.0.1:8000/test2/

     

  15. in view file , i use post method:

    <form action="/test2" method="post">
        {{csrf_field()}}
        <input type="text" name="title" id="title">
        <br>
        <input type="text" name="title2" id="title2">
        <br>
        <input type="text" name="title3" id="title3">
        <input type="submit" value="register">
    </form>
    

     

    in route , use post method:

    <?php
    
    use Illuminate\Support\Facades\Route;
    use App\Http\Controllers\Homecontroller;
    
    Route::get('/test', [Homecontroller::class, 'index2']);
    
    Route::post('/test2', [Homecontroller::class, 'index3']);
    
    
    //Route::get('/test', function () {
    //    return view('test');
    //});
    
    Auth::routes();
    
    Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
    
    Auth::routes();
    
    Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

     

    controller file:

    <?php
    
    namespace App\Http\Controllers;
    
    use Illuminate\Http\Request;
    use App\Models\Company;
    use App\Models\Customer;
    class HomeController extends Controller
    {
        /**
         * Create a new controller instance.
         *
         * @return void
         */
        public function __construct()
        {
            $this->middleware('auth');
        }
    
        /**
         * Show the application dashboard.
         *
         * @return \Illuminate\Contracts\Support\Renderable
         */
        public function index()
        {
            return view('home');
        }
    
        public function index3(Request $request){
            $a=$request->post("title");
           echo $a . "</br>";
            $a2=$request->post("title2");
            echo $a2 . "</br>";
            $a3=$request->post("title3");
            echo $a3 . "</br>";
            $validated = $request->validate([
                'title' => 'required',
                'title2' => 'required',
            ]);
    
    
    
    
    
            return view('test2');
        }
    
        public function index2()
        {
            $data1 = Company::all();
            //    dd($data1->customers);
    
            //   return view('test',compact('companies'));
    
            foreach ($data1 as $row) {
                foreach ($row->customers as $row1) {
                    echo $row->name . "__________  ";
                    echo $row->created_at . "__________  ";
                    echo $row->address . "__________  ";
                    echo $row->title . "__________  ";
                    echo $row->test . "__________  ";
                    echo $row1->id . "<br>";
                }
            }
        }
    
    
    }

     

    i dont use get method in MVC

  16. 1 hour ago, requinix said:

    Apparently something is trying to hit /test2 using GET instead of POST. Is it from the form? Is there any kind of Javascript involved? Does the form you posted, which clearly states it does use POST, actually have anything to do with the issue?

    i active Authentication system(Login) in my project...

    Is there a relationship between this error and the login system?

    i dont use from javascript in my project...

    Is my code system for designing validation correct?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.