Categories
Mastering Development

php function error passing form field as parameter

I created the following function to strip web addresses from submitted form fields. I did this as a spam prevention measure. <?PHP function scrubURL($field) { return preg_replace(‘@((https?://)?([-\\w]+\\.[-\\w\\.]+)+\\w(:\\d+)?(/([-\\w/_\\.]* (\\?\\S+)?)?)*)(?:[?&]\S+=\S*)*@i’, ”, $_POST[$field]); } ?> I try to reference the function in my form processing: $_POST[‘first’] = scrubURL($_POST[‘first’]); I’m getting the error: Undefined index: http:// somewebsite.com Somehow, it’s […]

Categories
Mastering Development

Error on Assigning Alias on Declared Variable Field Names against Declared Variable Data

I have created MySQL query interpolation below in Workbench. The query was so fit to my needs except that I could not effect the @vendor1/2/3 variable as the field name for my data @vendor1/2/3price. I am getting an error on AS @vendor1 in this line SELECT item.name, container, size, @vendor1_price AS @vendor1 which what I […]

Categories
Mastering Development

Some video and audio properties missing while recording with getUserMedia()

I am using the below code to record a video through web cam and I need to transcribe this and take the audio from that video and find some keyword match percent. The video is recording and sending to server, displaying properly also. But there are some audio and video properties missing when I checked […]

Categories
Mastering Development

Setting URL with logged in user id from the front end blade in LARAVEL 6

Hello I’m trying to set an URL (href) from my blade(welcome.blade.php) to logged in user’s user profile. My url has to be like this -> sample.com/profile/24 there, 24 is logged in user’s user id <a href=”‘)}}” class=”btn btn-primary”>profile</a> but when I run the code it gives me following exception, Facade\Ignition\Exceptions\ViewException syntax error, unexpected ‘}’, expecting […]

Categories
CMS Development Magento

Parse error: syntax error, unexpected ‘url’ (T_STRING), expecting ‘,’ or ‘;’

This is my code <div class=”gallery-placeholder _block-content-loading” data-gallery-role=”gallery-placeholder”> <?php /* @escapeNotVerified */ $json=$block->getGalleryImagesJson(); $array = json_decode($json,true); foreach($array as $item) { $imgurl = $item[‘full’]; echo ‘<img alt=”main product photo” class=”gallery-placeholder__image” “.$imgurl[‘url’]. “/>’; <br> } ?> </div> and I am getting error on this line echo ‘<img alt=”main product photo” class=”gallery-placeholder__image” “.$imgurl[‘url’]. “/>’; as Parse error: syntax […]

Categories
CMS Development Wordpress

Echo short code syntax

I want to make dynamic short code so insert php code of metabox text value to short code. I wrote this: <?php echo do_shortcode(“[svg-flag flag=\””.get_post_meta($post->ID, ‘ozellikler_text’, true);”.\”]”); ?> Error : Parse error: syntax error, unexpected ‘;’, expecting ‘,’ or ‘)’ in /home/deniztas/themeforest-deneme2.deniz-tasarim.site/wp-content/themes/html5blank-stable/my_homepages/right.php on line 14 I explain what I want step by step: There is […]

Categories
Development

Laravel join error while joining using model

I am trying to write a join between two tables. I have both tables as models and I am trying to join them. Here is what I have tried, Route::get(‘test’, function () { //order details $orders_details = OrderDetails:: where(‘SKU’,’LIKE’,’ROUTEINS%’) ->limit(10) ->join(‘[dbo].[Orders]’, ‘[dbo].[Orders].OrderNumber’, ‘=’, ‘31966862’ ->get(); return response()->json($orders); }); Error: Parse error: syntax error, unexpected ‘;’, […]

Categories
Development Linux

Empty string syntax inside vimrc defined via nix home-manager

I want to use home-manager to declare my vim configuration inside a nix-expression with the extraConfig option. I’m trying to run the example .vimrc configuration from coc.nvim and one line reads: set statusline^=%{coc#status()}%{get(b:,’coc_current_function’,”)} Inside a minimal home.nix I set it like this: { config, pkgs, … }: { # Let Home Manager install and manage […]

Categories
CMS Development Wordpress

PLESE THIS PHP CODING ERROR HOW TO SOLVE MY PROBLOM

PLESE THIS CODING HOW TO SOLVE MY PROBLOM. Parse error: syntax error, unexpected ‘if’ (T_IF), expecting ‘,’ or ‘)’ in /home2/nikithaonlin/public_html/wp-config.php on line 87

Categories
Development PHP

Getting error while declaring constant inside class using PHP

I am getting following error while declaring the constant using PHP. Error: A PHP Error was encountered Severity: Parsing Error Message: syntax error, unexpected ‘.’, expecting ‘,’ or ‘;’ Filename: libraries/SmsTemplateManager.php Line Number: 5 My code is below: SmsTemplateManager.php: class SmsTemplateManager { const STORE = APPPATH .”json/sms_api_template.json”; public $document; public function __construct() { $this->document = […]