Categories
PHP

Multipart/form-data showing 500 error in console in live server

Please take a note that the form works well in live server, This is my image upload controller: function uploadPhoto() { $this->load->helper(‘url’); $this->load->model(‘photo_model’, ‘picManager’); $this->load->model(‘user_model’, ‘userManager’); $result = array(); $user = $this->userManager->get($this->session->userdata(“user_id”))->result_array(); $user = $user[0]; $user_id = url_title($this->session->userdata(‘user_id’)); if(DEMO_MODE == 1) { $result[“status”] = 500; } else { if($user_id == null) { $result[“status”] = 0; […]

Categories
PHP

Scrape text if there is no meta description to scrape

I used this code for a scraper. But I want that if there is no meta description, the text in all ‘s at the website is description. How can I do it?

Categories
PHP

Can’t cope with Xdebug + Sublime Text

Environment: Ubuntu, nginx, Sublime Text 3. I installed xdebug, XDebug Client for Sublime Text. php -i PHP Version => 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 xdebug.remote_enable => On => On xdebug.remote_port => 9000 => 9000 xdebug.remote_host => localhost => localhost nginx server { root /var/www/html; location / { # First attempt to serve request as file, then # as directory, […]

Categories
PHP

Update data in xampp database

I have to update my database in correspondance to email.I am using Android Networking to update data in my database but it only is giving me server timeout. This is my PHP: <?php if(isset($_POST[‘update’])) { $hostname = “localhost”; $username = “root”; $password = “”; $databaseName = “truck_loader”; $connect = mysqli_connect($hostname, $username, $password, $databaseName); $name = […]

Categories
PHP

Login depending on role

How can i redierect a user from the login window to the specific page? I try to make a site for students/teachers and i want students to have a specific homepage with specific options, and the teachers to have a different one. I have tried this code but it only sends me to one of […]

Categories
PHP

Usage of Woocommerce’s template system

I am trying to use Woocommerce’s wc_get_template function to load my own templates, but it dosen’t seem to work (it’s not outputting content from the template files), together with my Woocommerce plugin. Below is what I have tried: plugindir/templates/testing-template.php: <h1>Output stuff</h1> plugindir/pluginname.php: if(in_array( ‘woocommerce/woocommerce.php’, apply_filters( ‘active_plugins’, get_option(‘active_plugins’)))) { function template_loader(){ wc_get_template(‘testing-template.php’, array()); } add_action(‘init’, ‘template_loader’); […]

Categories
PHP

How to set library_path in config for ImageMagick library which is installed in windows machine

I’m getting the following error while I try to crop an image using ImageMagick library. “Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct”. So the library is installed on my windows machine in program files(x 86) folder. I have set the […]

Categories
PHP

Can you implement the Send Intruder technique to a project in Java, Android Studio or php?

I would like to know how Burp Suite performs the capture of the http request and how it is modified and how it is sent back to the destination server with the POST method. And I would also like to know if that attack can be implemented to a project in Java, Android Studio or […]

Categories
PHP

Sending a Mail using SMTP PHP phpmailer

I want to be able to send a mail to my Email address whenever I fill in and submit my contact form. I followed a tutorial on how to do that but unfortunately it does not send a mail to mailbox. Everytime I submit the form it justs returns the error message ‘There is an […]

Categories
PHP

Retrieve array element from Wikipedia API

I’m having the exact same issue as the author of this question: https://stackoverflow.com/a/17166962/766141 but the answer there isn’t working for me. API Request: $searchQuery = str_replace(” “,”+”,$value); $url = ‘https://en.wikipedia.org/w/api.php?action=query&prop=extracts|info&exintro&titles=’ . $searchQuery . ‘&format=json&explaintext&redirects&inprop=url’; $scrape = file_get_contents($url); Approach #1: $data = json_decode($scrape, true); $pageid = $data->query->pages[0]; echo $data->query->pages->$pageid->canonicalurl; Shows: Notice: Trying to get property of […]