« first day (289 days earlier)      last day (21 days later) » 

10:05 PM
0
Q: turning numbers into date and time

user1721230How do turn some numbers, i.e. 20020415 into the date 15/04/2002? Everything I do seems to change 20020415 to today's date. Here is what I have so far: //[DOB] function dob_func( $atts ) { $dob = get_field('dob'); $dob = date('d/m/Y'); return $dob; } add_shortcode( 'dob', 'dob_func' ); The cod...

0
Q: nginx - 403 Forbidden

michell90I've trouble to get aliases working correctly on nginx. When i try to access the aliases, /pma and /mba (see secure.example.com.conf), i get a 403 Forbidden but the base url works correctly. I read a lot of posts but nothing helped, so here i am. Nginx and php-fpm are running as www-data:www-d...

0
Q: PHP code not parsing my CSV file correctly

nate dinoI have a CSV file and I want to parse it using PHP: Access_Code,Home_Address, Work_Address 1, 100 Broad St, 100 Main St 2, 200 Broad St, 200 Main St 3, 300 Broad St, 300 Main St Here is my code: $file = fopen($target_path,"r"); while(!feof($file)) { $groups2 = fgetcsv($file,","); print_r($...

0
Q: How to automatically hit download URL and download a file using javascript?

Lukas LikesnotesIn WordPress there's a feature that exports your data into xml files. You can hit this URL with parameters and it will start downloading XML file. The cat parameter indicates the ID of the category containing posts you want to include in the XML file. The problem is that I have over 200 categori...

0
Q: how to send javascript array with ajax to php?

user3072117I make a fucntion in html when I call function(click button) is to send array(json from) but it's not work, Help me to solve this a problem please! thank you everyone. :) html <? $array = {include for database} $js_array = json_encode($data); ?> <script> var dataArray = <?php echo $js_arr...

 
10:17 PM
0
Q: PHP Generate XML with invalid carachter?

jlafforgueI want to create an xml file that contains invalid characters such as "&", "=" ... etc. Is it possible because I can not find the solution? Can I convert these characters? I wonder if it is not better to generate JSON instead? Thanks

0
Q: How to write a path to a Windows server from a Linux machine in php

asdk77My script was run under Windows correctly. It can copy files from a shared folder on a windows server. I wrote the path as following: $path = "//192.118.20.21/Shared_Folder/..."; Now I run the script under a linux machine. It can't work now, and I find the path is not correct. I used "is_dir()...

0
Q: .htaccess mod_rewrite to a separate script if it ends with a string

M MillerI'm writing a simple CMS that will rewrite http://host/path/to/resource to http://host/cms/render.php/path/to/resource (unless a file exists at that location, e.g. an image). How can have it redirect to a different script if the request ends with a certain string? For example: http://localhost/...

1
Q: Segfault and/or "Fatal error: Unknown: Failed opening required..." when running scripts located in CIFS mounts

MM.I compiled PHP 5.4.22 and 5.5.6. In both versions I can't run any scripts that are located in a CIFS (SMB/Samba) mount. If I try to run it the usual way, I get a weird error message: user@machine:/mnt/windows# /opt/php/bin/php test.php Fatal error: Unknown: Failed opening required 'test.php' (i...

0
Q: Passing in page specific content into a PHP included header

Jacob BullerI am creating a website for a local company and I am splitting off the header for each page into a individual php page which I then include into each page. I was wondering what would be the best practice to insert individual description and title content into the php header for each individual pa...

0
Q: WP pre_get_posts and is_home not working

user3072220my problem is that I just want two posts on the home page, and when you click through the pagination, 10 pages on each (supposedly, quite simple). But I'm getting two posts on all the pages, not just the home page. I've read countless articles, and none appear to have my problem. They say to use ...

1
Q: PHP Email - Should be built in the headers or in the body? (what's more correct)

ChemistAs I'm working on building and sending email in PHP I've noticed that sometimes people put the code for the message and file attachment in the headers and sometimes in the body. They both work. So what's more correct, or does it make a difference? Here's example code: In the headers if (is_uplo...

0
Q: automate the process of an online converter without an api

RichardI came acrossthis service ( image extractor for pdf files ) and it works ok. How would I go about automating the process of submitting the pdf and downloading the zipfile from their server? Is this crosssite scripting? thanks

0
Q: Saving login session state with Instagram OAuth

db-userCurrently I have a page with a link to OAuth using Instagram. If the login is successful, I am redirected back to the same php page with the user's information. However, if I refresh the page, the user will see the login link again (it's hidden when the user is logged in). I know I should use coo...

0
Q: how to sync a folder on local machine with server

osyanI'm developing a local site (with wamp server) to monitor some live data coming from a USB port and then store them in database. Recently i need to have same data on a site which can get the data from that local machine. Lets think that Local machine will be always ON and connected to both data p...

0
Q: Removing .html and .php from links in a Windows Server

user3072304As the title says, I would like to know how to remove ".html" and ".php" from links in a windows server. Most of the information I have found about this subject was only valid for linux servers. Only today I heard about the file web.config and got new material to study. Nevertheless, I am still...

0
Q: How to create a simple but flexible Clean URL in .htaccess with Apache Mod_rewrite?

Radical_ActivityI have just started to be familiar with Apache Mod_rewrite and I have falied to achieve my goal. I am building a website where I'd like to replace the ugly URLs with Clean, user firendly URLs. I have currently created some files already, but I'm not sure if I'll create clean urls, I'll be needin...

0
Q: Google Maps API formatted_address

user2972131I am using php to convert latitude and longitude to an address in a WordPress custom field. It works how I want except I get the country at the end of the address (ex. 1234 1st st City State 90210 USA). This is the code I'm using to make the conversion. Any thoughts on how to remove the country ...

0
Q: Running a PHPUnit Test yields "Class Not Found" Error

DennisThis is a question on PHP Unit Test giving me a Class Not Found Error. Background I am using Zend Studio 10.5 to develop a Zend Framework 2 application. I have a few modules loaded, including ZfcUser and BjyAuthorize FedcoUser is the module that has a Controller Guard that uses guard rules of...

-2
Q: Intercepting and changing all links on all pages

RubberDuckI have a blog that contains several pages with links to several of my products. Lets say the link is in the form: http://www.myblog.com/product/product1 http://www.myblog.com/product/videox http://www.myblog.com/product/photoshop http://www.myblog.com/product/pr4 I have to change this link to ...

0
Q: PHP help for the beginner

user3072330I am very green to php and I am trying to create code that will allow me to enter information to a database I constructed. Everytime I run it though I get an object not found error 404. I have searched google and have found some information however I am unable to correct my error, Any help wou...

0
Q: PHP - First browser game, QUESTS

user3072339Sorry for my english. Please help me, im developing an browser game (my first bigger project) on my own, and i have a question. I have table with users and in that table i have columns with questID and questProgress. By questID u get your quest that u are supposed to make, questProgress will be ...

-1
Q: Contact form not working - JS/PHP

user3072296Hello having some issues trying to get a contact form working on my website. The form seems to submit as it should (from my knowledge) but I don't receive an email afterwards with the submitted details. The email that was set-up to receive these form submissions is working as I've tested via dire...

0
Q: Laravel see the execution time from terminal

user2293111I am a new Laarvel User. Before I was using Codeigniter. In Codeigniter it was very easy to see the log files and execution time by doing tail -f. I saw Laravel has log files in app/storage/logs directory. The problem is that log file only give me errors it doesn't give any execution time or que...

0
Q: Formatting an RSS Feed Date and Time

MizAkitaI have an RSS Feed I used FeedRoll to create it an i am pulling it in via xslt into my site. My question is what formatting via javascript would I have to create to format my dates to not look like: December 04, 2013 05:00:00 am and instead look like: Dec 4, 2013 5:00PM The script FeedRoll p...

0
Q: Count in foreach loop by same model and condition

JamesI would like to get the count (total) of values in my foreach loop which share the same 'Model' and 'Condtion'. To help you understand better, here is a representation of how my data looks like Product Name | Condition --------------------------------------- iPhone 3G 16GB ...

0
Q: Generic 'ApplicationException' in XP-Framework

Igor LankinIs there any generic exception type except XPException that I can throw? Java and .NET have ApplicationException. Is there a similar exception type in the XP-Framework?

0
Q: How are Zend Framework JSON Endpoint Created?

Zachariah MorenoWhere in the code below is the /home/dashboardfilegrid JSON endpoint URL created? Does a new model automatically result in a new JSON Endpoint URL? Environment Zend Server - Version 5.1.0 PHP - Version 5.3.6 Zend Framework - Version 1.11.3 MySQL - Version 5.1.52 View var gridDOC = new dojox....

0
Q: URL, page names without extension

ANWI am trying to have my pages accessible with example.com/about, example.com/contacts instead of example.com/about.php & example.com/contact.php I am not sure how this is done, but I was able to do it by creating link <a href='site.com/about'> about </a> And I have my index.php set as $URI ...

0
Q: Adding data to a reference to change the referenced array in PHP

DevonI have built a function to retrieve the last specified key of an array, it references the array and displays it fine, however, when I try to add to the reference variable, it does not affect the referenced array. Here is my code: class test { public function __construct() { // For t...

0
Q: Laravel - Check if @yield empty or not

user2840318Is it possible to check into a blade view if @yield have content or not? I am trying to assign the page titles in the views: @section("title", "hi world") So I would like to check in the main layout view... something like: <title> Sitename.com {{ @yield('title') ? ' - '.@yield('title) ? '' }} <

0
Q: Removing line breaks with PHP

ArdillaI got a little problem here. The thing is that in my database I got a text, and then I print it onto the screen and the code goes like: <p>Text 1</p> <p>Text 2</p> Thats the output in HTML cause I use tinyMCE plugin. Goes well so far. The thing is, that I want to put it into a javascript vari...

-1
Q: JQuery Ajax $.get request not working in IE

user3072379Hi I have this code that populates two lists the lists are populated using Jquery ajax call or functions $.get("pgs/dpg.php",{pg:"119", type:"yrs"},function(data){ $(data).find("row").each(function(){ $("#bhv_year").append(new Option($(this).children(":nth-child(2)").text(),...

0
Q: Order by descending and returning the record number to use for ranking

wnajarI'm trying to rank users very simply by their reputation, which is stored as an int column in a MySQL table of users. In order to find out which users have the highest reputation from highest to lowest, I would do something like: SELECT * FROM users ORDER BY reputation DESC Which would give m...

0
Q: select and join on max only if like

user3032474I did this query SELECT `J`.`jobNo`, `J`.`dealerTagNo`, `J`.`tagNo`, `J`.`totalSize`, `J`.`rugDesc`, `J`.`amount`, `L`.`TagNo`, `L`.`Location`, `L`.`fullDate` FROM `Jobs` AS `J` LEFT JOIN `Locations` AS `L` ON `J`.`tagNo` = `L`.`tagNo` AND `L`.`fullDate` = ( SELECT ...

0
Q: Use bound variables in LIKE query

user2921557just going through my site and testing the forms for sql vulnerabilities and forgot i hadn't get converted my search query to use bound variables. The addon for firefox (Sql Inject Me) is excellent! On a side note, are there any more add ons i can use that will check for security issues, loops h...

-1
Q: PHP Fatal error: Cannot use object of type mysqli_result as array in file.php

user2403721I have the following code: $productQuery = "SELECT ean, name FROM products WHERE category = '$category'"; $productResult = $mysqli->query($productQuery); while ($productRow = $productResult->fetch_assoc()) { $productPriceQuery = "SELECT ean, price+shipmentCost AS totalPrice FROM...

0
Q: javascript adding/deleting to/from text file

user3068010I'm trying to use jquery, ajax and PHP to add characters to a text file. The POST ajax call returns successful, but the PHP function is not executed. Does anyone see my error? Workaround? <html> <head> <title>AjaxSend</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery...

0
Q: Most relevent results php/mysql

AjqualixI am having trouble sorting results by relevancy. I have something like: $search = $_GET['search']; $key_terms = explode(" ", $search); $query = "SELECT * FROM sentence WHERE"; foreach ($key_terms as $each){ if($each != ''){ $i++; if($i == 1){ $query .= " keywords LI...

0
Q: Aajax doesn't change my $_SESSION variable

RainwalkerJakeI have main.php page with a $_SESSION variable, i call ajax to modify this var, on the ajax the $_SESSION var change but when i check it on my main.php don't. PD: I have session_start(); on each and the ID on session_id(); is the same. Curious INFO: If reload the page the values are modified ...

0
Q: Codeigniter sessions errors and workarounds

Phil CrossSo after reading the documentation on the session library for CodeIgniter, I'm finding it rather confusing. My problem has arisen from the need to store a few bits of information (a filename, a product ID and an array of colour IDs). I'm using flashdata for this bit. I got a 502 error. Removing...

0
Q: run php code compiled by bcompiler on php 5.5

Laci KI would like to run a php script on a IIS 8 server with php 5.5 which is compiled with bcompiler. Sadly there is no way I can get the original source code and the developer won't recompile it with any other PHP 5.5 compatible solution like Blenc or SourceGuardian I hate these kind of behaivor sp...

0
Q: .htaccess -> RewriteRule, subdomains -> stop redirect

Patryk SzramI want add to my website subdomains. I have one file with that format: starwines.com.pl / test.php? page = first starwines.com.pl / test.php? page = second starwines.com.pl / test.php? page = three ... subdomains how i want to have: first.starwines.com.pl second.starwines.com.pl three.starwi...

0
Q: best PHP IDE to work on magento websites

AlanCurrently I'm using Dreamweaver 8 to implement php projects(magento websites) but it is so annoying, I can't even debug my code unless i use log message written into text file or see the errors online on website. Could you please recommend php IDE that I can debug my code, also it has integrated...

0
Q: Fix Decoded PHP Error with Exceptions

Luis Filipe ÁvilaHave you ever seen something like this: $template = $mailingList->getTemplateById( request( 'template' ) ); jmp; Exception { return null; echo '<script language="javascript">$("#status-message").html("' . $language->get( 'Sending page %1 of %2, Please ...

0
Q: Creating table that will loop and list down the items

user3072443I want to transform my div's into a table so that the items will be seen with the informations. <div class="text">List Of Product </div> <div class="view1"><?php include('config.php'); $result2 = mysql_query("SELECT * FROM category"); while($row2 = mysql_fetch_array($result2)) {...

0
Q: Wordpress Custom Gallery Function

user3072439I need to change some code from the WP-Bootstrap Wordpress Files. In their code they remove the standard gallery code and replace it with their own which works fine accept it doesn't properly account for Rows. function gallery_shortcode_tbs($attr) { global $post, $wp_locale; $output = ""; $ar...

0
Q: Php Mysql Table Search/List

VeritasI'm creating a project manager, and I'm trying to list all available projects in a C# array by posting data. That being stated, I can post data fine, and I'm not a pro, but I know basic sql commands and can work my way around. What I'd like to do is get the number of rows in a table, loop throug...

0
Q: Multiple calls to imagecopyresized on the same destination image only result in one image being copied onto the destination

MorslaminaI'm using openlayers to power a map with multiple zoom levels. I've written a quick PHP script which takes individual tiles on the map which already exist on the hard drive, resizes them and drops them on to a larger tiles. The larger tiles then form the basis for larger zoom levels on the open ...

 

« first day (289 days earlier)      last day (21 days later) »