Site URL alias using mod_rewrite

I am developing a website, however I am trying not to have the unattractive url being displaced example instead of : /my_project/master_page.php?page=home and would like to display /my_project/project/welcome and so on, I am trying to achieve this by...
more »

2017-04-18 23:04 (0) Answers

Instance of PDO in class connector

I'm working on a project today and i've been working for a while now and i don't see what i do wrong here. Can someone give me the right example. Thnx a lot! Connector: class Repository { private $connector; public function __construct(Config $co...
more »

2017-04-18 23:04 (1) Answers

PDO returning empty result

I have the below PHP script which generates a MySQL query and runs it, however currently the query is returning an empty result. $sth = $dbh->prepare("SELECT TeamID FROM UserTeam WHERE UserID=? AND Deleted IS NULL"); $sth->execute(...
more »

2017-04-18 23:04 (3) Answers

How to split these regex matches?

I want to match the first few paragraphs from html code and I have this code so far: $page_contents = '<html><body><p style="asdas" class="asd asdas">lorem ipsum 1</p><p>lorem ipsum 2</p><br></body><...
more »

2017-04-18 21:04 (0) Answers

Proper noun capitalization in MySQL

Let me set the stage. I am working with a MySQL to input customer company names, for example "My Company" using PHP/PDO. In PHP, I am aware of the ucwords(), ucfirst, strtoupper(), and strtolower() functions. Are there any good practices as to how to...
more »

2017-04-18 21:04 (0) Answers

Get Query String URL Path in PHP with $_SERVER

I have a form that has a "textarea" where I'm looking to capture the full URL of the page the user is on. Once this form is submitted I'm looking to include the full URL into an email that goes out. However, the problem I keep running into is that ...
more »

2017-04-18 20:04 (1) Answers

Column not found in SQL laravel 5.4

I'm Trying to publish post with user that register in my app,But This error happened: and I'm using XAMPP and my posts table is this picture and this error is in myphpadmin: my PostController is: use App\Post; class PostsController extend...
more »

2017-04-18 20:04 (2) Answers

Wordpress cron job using cpanel issue

I have installed wordpress on my server and trying to send emails using cron jobs. So if even someone is not visiting the site the cron job should send an email to the user. So for achieving this I have made my wp-config.php file like this define('D...
more »

2017-04-18 18:04 (0) Answers

fetch result from db by percents

I am working right now on laravel 5.0 project, I have table with leads and table with leads history, I have form that the user choose how much leads to pick up and percents of how many of them are new, leads that doesnt exist in leads history table a...
more »

2017-04-18 17:04 (0) Answers

PHP form submit url redirect

I am trying to add a URL redirection code on form submit but I need to know where to place URL redirection code? My form works fine, but I need to redirect on submit to another URL. <?php session_start(); if ( isset($_POST['guvenlikKodu']) &&...
more »

2017-04-18 16:04 (0) Answers

Save/Alphabetize XML Responses in a Foreach Array

I'm new to php and am doing this project to teach myself a bit. I'm importing XML data from a Reuters RSS feed and would like to sort the content of all the responses alphabetically. I've had no problem loading the information I want to the page us...
more »

2017-04-18 15:04 (2) Answers

facebook login gives ERR_TOO_MANY_REDIRECTS

I am trying to log in with Facebook, but it gives me following error: ERR_TOO_MANY_REDIRECTS It was working perfectly some times ago, suddenly it gives above error. Already tried with this answer: Redirect-error but it didn't help. ...
more »

2017-04-18 14:04 (0) Answers

INNER join doesn't work with PDO in PHP

I'm facing a very strange problem. I have a SQL Server query which is very simple and working fine in any environment. I ran it and it was fine, but in my PHP, code doesn't work for some reason, and it returns empty array: function conexion() { $us...
more »

2017-04-18 14:04 (1) Answers

PHP PDO Camel Case

<?php $query = "SELECT p.id as ItemId FROM production p"; $pdo -> beginTransaction(); // PDO try { $pdo->setAttribute( PDO::ATTR_CASE, PDO::CASE_NATURAL ); $result = $pdo->query($query); $test = $result->fetchAll(PDO::FETC...
more »

2017-04-18 14:04 (0) Answers

Data Loading issue

I have more than 30 million data in database that is using cakephp 3.3 and dedicated WHM server and MySQL. The search result is taking almost 40 seconds to 2 minutes even with filtering. I used a stored procedure, and extra datas to load other datas ...
more »

2017-04-18 13:04 (0) Answers

Laravel Passport 404

I installed Laravel Passport using the Laravel docs, the Laravel version is 5.4. Everything worked fine so far now I add these lines into my view: <!-- let people make clients --> <passport-clients></passport-clients> ...
more »

2017-04-18 13:04 (1) Answers

Laravel - Manipulate data from model

I may be over complicating this or missing something very simple so forgive me if I am. I am trying to manipulate/map some data in my model. A very simple example of what I am trying to do: I have $model->attr, this will return whatever is in m...
more »

2017-04-18 12:04 (2) Answers

Error validating form with a regular expression

I'm using this regular expression validation with codeigniter 3.x $this->form_validation->set_rules('FieldName','FriendlyName','trim|required|regex_match[/^([a-zA-Z]{6}[0-9]{2}[a-zA-Z]{1}[0-9]{2}[a-zA-Z]{1}[0-9]{3}[a-zA-Z]{1})$|^([0-9]{11})$/]...
more »

2017-04-18 12:04 (1) Answers

PHP mail function not works

Why is my PHP mail script not working? I already tried with the URL http://example.org/mail.php?email=myemail@email.com&subject=hello&message=hello&from=email@email.com but nothing happens. Here is the code for my script: mail ($ema...
more »

2017-04-18 11:04 (0) Answers

Data from 3 related tables in laravel

I have three tables. table1 table2 table3. table1 is related table2 with one to many relation. Also table2 is related table3 with one to many relation. I need to get data from these tables with some columns of table1. I tried follwing code. $rece...
more »

2017-04-18 11:04 (3) Answers

Detect keyboard mashed email addresses

We're trying to reduce our email bounce rate and often we get people mashing their keyboards. Here's a few example "email addresses" on our suppression list: aaaaaaaaaaaaaaaa5@hotmail.com aaaa_a@hotmail.com 991022865@gmail.com 725668844@gmail.com 82...
more »

2017-04-18 11:04 (2) Answers