I need to get the IP of the client. I am able to get it through PHP variable "$_SERVER['REMOTE_ADDR']". I get this ip from server side php to html page through AJAX request but when I want to use this IP value in JavaScript it is showing that th
In Eloquent 5.2.7 I was able to add to the result set using foreach($page as $xp => $xv) { $content[0]->{$xp} = $xv; } Where $content was a DB::table()->get() result. Now, on the latest version I get the following errors: Indirect modification of
When writing: echo date('H:i:s', strtotime('Mar-29-2016')) . "<br />"; echo date('H:i:s', strtotime('Apr-3-2016')); I'd expect to get: 00:00:00 00:00:00 But in actuality get: 00:00:00 16:16:00 Changing to: echo date('H:i:s', strtotime('Mar
I am not able send links in email. I am using wp_mail() function to send email. When i set header $headers .= "Content-Type: text/html; \r\n"; this header removes href attribute in received email. i am using wp_editor for textarea. I also tried
I'm creating a blog with wordpress, I'm using the DIVI theme and I need to change the appearance of the category pages of the blog... what's the easiest way to do that? I understood I should look for category.php in the editor and create a new php fi
I have a php function that has an array of all of these interest selections for users to choose from. I populate that data like so in a table: foreach($interests as $key=>$value){ ?> <input type="checkbox" name="targetInterests&quo
i'm trying to send a mail. i want to use Gmail server to send, for now i just want it to send to the same account from its being sent. i'm using YiiMailer extension because it seems to be easy to use, this is the action i have in my controller: publi
I have working on game where users can send each other challenges. These challenges have timed intervals, say hours, days etc. When a user logs in the times set can be retrieved through mysql then displayed as a countdown clock using java script to s
Amazon Linux lastest PHP 5.4.19 (cli) (built: Sep 3 2013 23:19:23) nginx version: nginx/1.2.9 installed PHP-FPM: PHP 5.4.19 (fpm-fcgi) (built: Sep 3 2013 23:22:01) phpinfo() is working pma.nginx.conf: server { listen 80; server_name pma.my.server; ro
So I have these two pages: pageOne.php and pageTwo.php.The form is in pageOne.php: <form method="post" action="pageTwo.php"> .... </form> and doing all the data collection-validation-insertion and sending out mails in pageT
I'm creating a mail service within my application that has the body of the email stored in the database prior to sending it out to recipients. Each mail body is a partial view script that has the necessary parameters injected into it via Zend_View. W
I'm not entirely sure the wording for the title is correct, but what I'm attempting to do is run and execute PHP files from within the Lift framework. I'm not after any url queries to a PHP file residing on a server, more interested in somehow gettin
I'm writing a method which returns an function argument by its number. protected function parseArgs($str, $args) { return preg_replace('|#(\d)|e', '$args[\\1 - 1]', $str); } $str - a string with '#N' where N is a number of argument $args - array of a
I am doing a form that displays the questions and answers in a database and now I need to save the answers marked by the user. I need a name for each RadioButton or select dropdown. PROBLEM: I combine php and html and i don't know how to pass the rad
This is the code for the form: <div id="regform"> <div id="regform-top"> <h2>User Registration</h2> <p>Please complete this form</p> </div> <form id="register-form" name="regi
I want to know that how can i fetch unread emails from gmail account. I have a gmail account i want that all the unread emails from gmail accounts are coming to my site though php. I have been implementing various codes but they are not helping me. P
I have many IF sentences that each start a function. Is there an obvious way to write this code much simpler? Every IF starts different function, but it still looks like an overkill. if ($this->machine == '' AND $this->date_from == '' AND $this->
I have implemented database driven ACL functionality using controller plugin predispatch() function. It's working fine. But it stopped requests to be sent on my error controller. for example if specified controller / Action is not defined then system
I am doing an OpenCart modification to an order total. This is the snippet of the code: <?php foreach ($data['totals'] as $total) { if ( $this->db->escape($total['code'])=="sub_total" || $this->db->escape($total['title'])="Su
I wrote a batch files which needs a set of arguments in order to run. I don't want the user to enter the arguments into a plain command prompt, I need to create a small UI which contains some labels and text boxes to enter these then I want to send t
I am trying to write a script that will read a remote sitemap.xml and parse the url's within it, then load each one in turn to pre-cache them for faster browsing. The reason behind this: The system we are developing writes DITA XML to the browser on
I currently have a form that has a hidden form field, populated based on a variable in the user's session. A function is called when this form is submitted, which processes the form, and this hidden variable is pretty important to it. Is it better to
I have a mysql fields like this: url_id time_spent ------- ---------- 120 14 120 97 120 14 120 97 I want to display only 14 and 97 based on url_id(DISTINCT). select * from table group by url_id,time_spent
I have 500 CSV files in this format: IndicatorA_Name.csv 1900 1901 1902 ... Norway 3 2 Sweden 1 3 3 Denmark 5 2 3 ... IndicatorB_Name.csv 1900 1901 1902 ... Norway 1 3 4 Sweden 1 2 Iceland 1 6 3 ... Years in columns, countries in rows. Notice that co
I'm struggling to design the server-side script that responds to requests from an Ajax application. In its current state, the app is divided into discrete pages (e.g., Orders, Items, Finances, etc.). Only when you switch between these pages does the
I'm unable to find any information on adding tasks to Windows Task Scheduler with PHP. I can use exec(). This has to work on IIS.Windows Schedule Task has a command line utility called Schtasks you can use this utility to add your task to Scheduled t
Lets say I have this string $string = "<html> <body> <h1> <b>aaa</b> bbbb "; I want the result to be "h1" because it is the latest unclosed tag another example if the string is $string = "<body>
I'm developing a single serving site in PHP that simply displays messages that are posted by visitors (ideally surrounding the topic of the website). Anyone can post up to three messages an hour. Since the website will only be one page, I'd like to c
How do I get the 'default' param if not specified? Consider the following: http://localhost/controller/action/id/123 In my controller, I can get the value of 'id' using $request = $this->getRequest(); $id = $request->getParam('id'); If the URL is ht
what are the benefits of using HTTP authentication with PHP (HTTP 401 headers) instead of using a normal form submit authentication??From security perspective, both the form based and HTTP Basic Access Authentication use plain text for sending the au