« first day (259 days earlier)      last day (51 days later) » 
00:00 - 13:0013:00 - 00:00

12:11 AM
0
Q: How to choose a certain string out of an array

XeroElixirI was wondering how to choose a certain string out of and array. Say this this is my array: $a=array("What Color is the sky?","How are you?","Can you spell 'the'?"); how would I echo just the first string?

0
Q: Proper way for concatenating 2 or more .js files into one in Cakephp

Lay GonzálezSuppose I have: common.js scriptA.js scriptB.js And suppose that both, scriptA and scriptB require functions that are in common.js Instead of copy-pasting common.js in both files, I would like to send a concatenation of common+scriptA and common+scriptB as used. I don't want to do $.getScrip...

 
12:23 AM
0
Q: Zend framework 2 module routing?

gGololicicI've done a lot of research and before I get into this new project I wan to ask you for opinon of arhitecture I should take. I am creating an application that is build with multiple modules that are not connected and I want to sperate them as modules. They will be developed separately. Now I wa...

0
Q: Sending a certain cell from the database to another PHP page

Poyraz SagtekinI am trying to send a specific cell to a PHP page and deleting that row which contains this specific cell. But it appears I am doing something wrong. This is how I sending the information: echo "<td><a href='delete.php?id= '$row['pid']''>Delete</a>< /td>"; and using it like this: $del = "D...

0
Q: Struggling with this undefined index

Lalien-Miles Lamar ColemanThis has made me feel like a total doofus. I know this undefined index stuff, and I made sure that the name matched the request thingy. But here it is. It's a file upload / registration form and whenever I upload something, it says that it's undefined. I tried switching it to GET, POST and REQUES...

0
Q: Auto-Update Wordpress Posts to generate slugs

Dan JI have bulk uploaded 10,000 or so posts onto my wordpress site, I used SQL query to change all posts to "publish", but the slugs aren't updating unless I do it manually, and I can only do 20-40 at a time efficiently. Is there a way (or script) to auto update every single post using a SQL query s...

0
Q: Possible to manipulate $_POST variable in php script and express it in another php script?

user2251229I've been trying to do form validation without using the url. So I thought that I would create a hidden field in my form and send it over to my validation php script. What I was hoping I would be able to do is set what ever errors there are in the form to this hidden field and return it. However ...

0
Q: Laravel Eloquent Eager Load Constrains

Lucky SoniI am using Laravel 4 and I have this Eloquent query (Which works fine): return User::with(array( 'order', 'order.orderfeature', 'order.orderfeature.feature.featureprice' => function($query) { $query ->orderBy('date_from', 'desc') //Latest price on ...

0
Q: Trying to post a form with multiple fields with same name as an array

Neta Metai am trying to post a form with fields that act like a table entries I think it would be best if i give an example: <form method="post"> <table> <tr> <td><label>Name:</label></td> <td><input type="text" name="appsDetails[name]" placeholder="Enter name" value...

0
Q: How can I have google maps API refind the longitude and latitude when place_changed is not activated?

David MckeeIn my web app, I give the user the ability to go back and edit the information that they entered. However, for some reason when they resubmit, the locations latitude/longitude does not recalculate. This happens when they don't change the job location. Is there a way to make google maps find th...

0
Q: This specific PHP function is taking 15 seconds to calculate. What part of it is causing the lag?

CanerI know this may look very specific but I'm new to PDO database connections and I had to rewrite this component. I used Php microtime to check what part of my code was slow to load and it narrowed down to the function below (called from a class file). Can you help me figure out what is the ineffic...

0
Q: submitting php form with ajax

Dan wscript in my header: <script> $(function () { $('form#ratingsform').on('submit', function (e) { $.ajax({ type: 'post', url: '/dev/scripts/ratevideo_vibrary.php', data: $(this).serialize(), success: function () { alert('form was submitted'); ...

0
Q: Prevent form resubmission

Qassim Hassan QdevPHP Prevent form resubmission After a user submits a form, and they refresh the page, it asks if they would like to re-submit the form. Is there anyway I should be structuring my code to prevent it? or is it something else? For the the record, it’s primarily for anti spam purposes. My php cod...

0
Q: Popover is not working

elLI have list of data in a table and provided a popover. Like when the pointer hovers to that image, it will pop the body of that data. It was working before I separated that view. I'm using yii by the way. This is my code for the table: <tbody> <?php foreach ($page_data['data_list']a...

0
Q: Making a form sticky from database values in php using functions

CodingtonI am having a problem figuring out how to make my form sticky. I made two functions one to populate a dropdown list and another to populate a radio button list. The names and values (I am using the power of two approach for a search page) come from a database. I can't figure out how to make the s...

-1
Q: How do I make a post answer non-caps sensitive, or have multiple answers?

XeroElixirHow do I make a post have multiple answers? And it would also be helpful if I could figure out how to make it non-caps sensitive. Here is an example: $a = "What is the color of the sky?" if($_POST['ans'] == "blue") { echo "Correct!"; } form: <form method="POST" action=""> <input type="...

0
Q: php is it possible to determine if a constant is user defined?

mysql_noobie_xxxxI know that in general I can check if a constant is defined with the following: defined('MY_CONSTANT') defined('PHP_EOL') The first one is my own user-defined constant. The 2nd one is created by php. Both can be checked with defined() and return a boolean value. My question is.. is there a w...

0
Q: How to use curl with php

aavHow do i use curl to get this website response, i need to get the website response from this website. <?php $ch = curl_init(); // set url $qry_str = '?dores=true&includeKeywords=facebook'; $cURL = 'https://accounts.clickbank.com/mkplSearchResult.htm' . $qry_str; curl_setopt($ch, CURLOPT_URL, $cU...

0
Q: PHP include path for subclasses

Christopher FranciscoI'm having an issue with the include/require path. Since the code style is OOP, the problem comes when subclassing, since the path is relative to the first includer file. For example: // path: /class/entity/A.class.php class A { /*definition*/ } // path: /class/widget/B.class.php require_once(...

0
Q: Foursquare venues search optimization

JonathanI have a search API call for Foursquare venue/search, and it takes around 4-5 seconds. I'm using PHP and library PHP-foursquare PHP-foursquare. As for parameters, I'm using bounding box as sw and ne points, and for "intent" I use "browse". I would appreciate any suggestion to make it faster tha...

0
Q: Scrape longitude and latitude from this html using preg_match

Ben PatonI'm trying to use a regex to extract just the longitude and latitude coordinates from this html. <div class="coordinates"> <i></i> <strong>Latitude :</strong> 46.369384765625<strong>Longitude :</strong> 2.56929779052734</div> </div> This is about as close as I can get at the moment: p...

0
Q: Customizing the text output by the WordPress function human_time_diff()

henrywrighthttp://codex.wordpress.org/Function_Reference/human_time_diff I am using human_time_diff() to output relative dates on WordPress posts. e.g. echo human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ) . ' ago'; This will output something like 34 mins ago How can I change the w...

0
Q: IE 10 (W7) doesn't like my JQuery

M.SidimI was asked by someone on stackoverflow to post an example of a problem I was having concerning using IE, by creating a new thread. As an issue arose from the other post that required a new thread. For those of you joining in to see this post, the problem I have is whenever I use JQuery and even ...

0
Q: Cannot insert into mysql table - mysqli error not working

FahadI'm trying to insert some data into a mysql table but the process doesnt go through and I get nothing printed for the error and I get Notice: Trying to get property of non-object in. I don't think I'm outputting the errors correctly. Looking at php.net it seems like I'm doing the error handling p...

0
Q: Remove CSS & JS files from Wordpress Main Page For Increase Pagespeed?

muhammad usmanWith the reference of wordpress load plugin css/js in functions.php w/ conditional tags answered by @maiorano84 i am using cforms, FancyBox, WP Page Numbers plugins for Wordpress. From Page Speed point of view i want to remove CSS and JS of these plugin's from all pages except single post page....

0
Q: Want to tinker with a woocommerce shipping distance plugin to allow me to calculate road miles.

Charlie Tupman I have every piece of the puzzle except how to insert the shipping postcode into my function. I get the base postcode by using: function get_base_address() { $address = $this->get_option( 'base_postcode' ); return $address; } Then I try and get the normal postcode the s...

0
Q: how do I use multiple databases to update multiple contents in rows

jihdehI am trying to use 2 different database to make actions, like I have three buttons approve,disapprove or retract which outputs the contents from a database. But if I click on any of the buttons it updates only one row. Here's d code: require '../../includes/databases/acctdb.php'; ...

0
Q: In Codeigniter, how to make controller run index() without having to write /index in url?

PrinceEnderI'm setting up my first personal codeigniter project and my .htaccess file is this: <IfModule mod_rewrite.c> # Turn on URL rewriting RewriteEngine On # If your website begins from a folder e.g localhost/my_project then # you have to c...

0
Q: PHP Mailer Fatal error: Class 'SMTP' not found

fooNot sure why I am getting this fatal php error because all my files and classes are setup correctly. Any help would be greatly appreciated. contact.php is here: <? session_start(); if (!isset($_SERVER['DOCUMENT_ROOT'])) { $_SERVER['DOCUMENT_ROOT'] = substr($_SERV...

0
Q: Magento add sub-menu to menu item in the navigation bar

Les JohnstonI have the following code in pop.html and I would like to add a sub menu under "contact us". I cant seem to accomplish this. I first edited my index.php home page which works fine, but when I go to magento store home pages the sub menus need to edited differently. I'm a bit of a novice and if ...

-3
Q: Storing Data to HTML Table without using a database in PHP

monnix please help me find codes in this matter... Thanks so much...

0
Q: Tokenize and Match using PHP

Kimjue Sooni would like to token a single Malay affixes word and match it with the word in my database. That Malay word is a user input data. so i would like to checker either the word input by a user either correct or not by match it with the word in my database. if it is wrong then we give them exactly a ...

0
Q: Stuck trying to link image in table cells to sql record

Jay Jibo'lekan Hamzai have created a table in html, in each cell i would like to link the image in it to a record in php but i'm a bit confused about how to go about it please help. <td> <?php $con=mysqli_connect("server","username","password","db"); $sql = "SELECT imgurl FROM Workshop_products WHERE id=XXX"; $res...

0
Q: Register form do not execute all code

LegarndaryI'm new to php, so i have a hard time finding my errors, and this one i simple can't find. the code i have simply don't register the user on submit, i have no qlue why it don't perform the last bit of code. Any suggestensions? <?php session_start(); ?> <!doctype html> <html> <head> <meta chars...

 
1:47 AM
0
Q: Creating a SQL INSERT from a CSV file w/ parsing

user2690363I would like to create a SQL INSERT query with a large CSV file I have. The problem is the names are not parsed out. They are listed as "John Doe" or "John B Doe" instead of "John" and "Doe" because I differentiate between first and last name (I am not concerned with a middle initial). Another ...

0
Q: How to parse a multiple choice problems and solution into an array format?

jack97For example, I have something like The study of standards for what is right and what is wrong is called _. a. pure science b. applied science c. ethics d. technology ... unknown number of choices ... ANS: C and I want to split it into ['The study of standards...

0
Q: Cakephp SQL error with join and fields

Testounet TestounetI'm creating a website and during the development I changed the database system from mysql to postgresql. Everthing seems ok now except when I want to join a table (or several) in the following way (without hasMany, hasOne, etc): $this->find('first', array( 'joins' => array( array( ...

 
2:05 AM
0
Q: Magento: Custom Customer Fields in checkout

David SarmientoI've succesfully managed to add custom fields to the customer. However I need these fields to show up in onepage checkout. I've overridden Mage_Customer_Block_Widget_Name and created my own customer/widget/name.phtml, added the attributes in the sql/xxx_setup/installer-x.y.z.php (added them to ...

 
2:23 AM
0
Q: How to use regex to grab URLs and then echo URLs from website?

JasonJust for fun, I'm trying to code something that will scan a website for YouTube URLs and save them. The URLs will not be within tags so I need to use regex. I have that part down. But how I do go about echoing the URLs from an array? What I have so far: <?php $website = file_get_contents('http...

0
Q: PHP MYSQL GET RECORD IN BETWEEN

user2954757here's the query: Select Clock from ras_attrecord where (Clock like '%2013-05-01%' and (Clock >= '2013-05-01 18:00:00' or Clock <= '2013-05-01 18:00:00')) order by Clock ASC the results are : 2013-05-01 09:00:00 2013-05-01 14:30:00 2013-05-01 17:30:00 I need to get the "2013-05-01 14...

0
Q: How to check if a user uploads a file to the server and use a dafault file if not

Jben KayeI have a code which allows file upload. (And uses it in an imagecreatefromjpeg). It throws an error handler when the user does not upload a file and forces him to. Now i want it to check if a file has been uploaded or not. IF THERE IS, IT WOULD USE THE UPLOADED FILE.IF NOT IT SHOULD USE THE DEFAU...

0
Q: Error iframe not scroll in Chrome when using facebook comment?

haitruonginfotechI added iframe facebook comment, in Firefox is scroll, but in Chrome is not, How to fix it ? <iframe src="https://www.facebook.com/plugins/comments.php?api_key=172666652872245&amp;channel_url=https%3A%2F%2Fs-static.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D27%23cb%3Df3a81f3cfd7ece2%...

0
Q: Can we import posts directly into Wordpress database?

user2081323We published a daily blog starting in 1998, almost before the word "blog" was invented. We had static pages set up in a folder structure, but /year/month/date/index.shtml + content here We switched to Wordpress in November of 2008 and are now scraping the archives 1998-2008 and converting to JSO...

0
Q: Checking cookies on other pages

Timothy BassettI am having trouble setting and checking cookies in PHP. What I would like to do is set a cookie on one page and on another page, check to see if that cookie exists. On the first page, I set the cookie using: setcookie ("conversionChecker", "anything", time() - 3600); and on the 2nd page, ...

0
Q: in Google Chrome, there appears to be an issue with using a form processor to process javascript-created Select menus

Gus MuellerMy code takes a series of form items and, using cloneNode, it replicates them and assigns new names and ids to the new copies of the form items. These new form items are then visible on the page. I can then type in some text into a text input or use dropdown menu (a select menu) to select an op...

0
Q: echo php javascript alert?

Anaes AriasHow can I echo this javascript if the php error messages is called? I have an error message setting that when a user misses his username or password it triggers an error message. The php error message is called by a php code. Here is the code: <?php echo showmessage($msg) ?> I have an alert ...

0
Q: Issue deleting rows in SQL of type varchar

pixandpugI am trying to create a form that will delete a row in a table based on the attribute a user selects from a drop down list of options. For some reason the first option, (attemptid) which is an int, works, but the other three (which are varchar) do not. The error handling I have set up to debug th...

0
Q: HTML5 Geolocation api with direction arrow

user2605793I am building a simple PHP based off-road navigation webpage for use on a smartphone that will display two icons on a Google map, one being my my current location and one my destination. As I move, the position of the icon for me will automatically update. Sample code to do the basic stuff incl...

0
Q: MySQL pivot tables - covert rows to columns

user2723490This is the structure of my table: Then I run a query SELECT `date`,`index_name`,`results` FROM `mst_ind` WHERE `index_name` IN ('MSCI EAFE Mid NR USD', 'Alerian MLP PR USD') AND `time_period`='M1' and get a table like How can I convert "index_name" rows to columns like: date | MSCI EAFE...

-4
Q: how to send money paypal using php code like this?

robertthis code is automatic refund paypal code click here i want to get automatic send money paypal code like above, how can i do ?

0
Q: If $var is empty dont work?

CyborgI run this code: <? if (empty($map)) {echo '<br />'; } else {echo $map;} ?> The problem is when the $map is empty it don't do <br /> I have tried this 2 methods to see if $map is really empty: echo $map; // It results empty and noting is shown on page. var_dump($map); // It results...

1
Q: How to resize an uploded image before using it in an imagecreatefromjpeg function?

Jben KayeI have a code that allows file upload and some text input. It uses the uploaded file in an imagacreatefromjepg and imagecopymerge. I want to resize the uploaded file to a definite size which is 255x175. how can i make it? Here is what is have: $now = time(); while(file_exists($upload...

 
3:09 AM
0
Q: Problems Using Class Library - Need to include directory of files

Jennifer BornI'm trying to use the following library, but am having SO many problems! v1.1.1 https://github.com/triplepoint/php-units-of-measure/releases <?php require './PhpUnitsOfMeasure/PhysicalQuantity.php'; require './PhpUnitsOfMeasure/UnitOfMeasureInterface.php'; require './PhpUnitsOfMeasure/UnitOf...

-2
Q: How to get dates in betwwen mysql

user2954757Table : ras_attrecord Field : Clock (date time) Table : staff_shift Fields: startdate (datetime), enddate (datetime) Scenario In my table there are multiple records of Time In and Time out. In order to get the timein, it will depend on the staff shift. for example, my shift is 2013-11-05 09:0...

 
3:27 AM
0
Q: Joomla - Force File Download / CSV Export

lautaro.draganI'm in need of help... this is my first time asking a question in SO, so please be kind :) I'm trying to force-download a file from php, so when the user hits a certain button, he gets a file download. The file is a csv (email, username) of all registered users. I decided to add this button to ...

0
Q: Change static nav menu to wordpress dynamic menu

DunkeyI'm trying to convert my static nav menu to WP dynamic nav. This is what I've got: <nav> <ul id="menu"> <?php $pages = array( 'index.php' => 'Home', 'services.php' => 'Services', 'sitemap.php' => 'Calculators', 'about.php' => 'About' ...

0
Q: error in Login php

Mohamad Noor Qusyairi Manlanit's said error..cannot login.. the username,password was exist in my database... this is my base.php code ?php session_start(); $host="localhost"; // Host name $username="root"; //Mysql username $password=""; //Mysql password $db_name="kuih"; // Database name //Con...

0
Q: Linking each text word or words divided by comma into an existing URL?

MezelderzI am trying to auto add each word or words divided by comma into an existing url. I have url lets say http://stackoverflow.com/search?q=HERE IS THAT TEXT. I have this function: function movie_cast( $atts, $content = null ) { return '<div class="movie_cast">Cast: '.$content.'</div>'; } add...

0
Q: Submit button from shortcode reloads page

neanderslobI have a problem that is a bit tricky to describe so please bear with me. I have a function in a wordpress plugin that populates a particular page. Within that function is a short-code to access another plugin. That other plugin produces a calendar on the page with a few buttons. (With me s...

0
Q: ORA-01036 oci_bind_by_name illegal variable/number

user2954863I have been trying to get this function to work, for context it is meant to be a session fetcher for my online store. It keeps erroring out on the oci_bind_by_name line. I was wondering why this is the case and possible solutions to this problem. function getSessionID($customerID) { global $...

-1
Q: How to creat 2 hour Blocks of schedule

thangHow to creat 2 hour Blocks of schedule. Example: Enter 8:00 -> 22:00 Show: 8:00 -> 10:00 10:00->12:00 .... 20:00 -> 22:00 . Please help me, thanks.

0
Q: How to implement Follow board feature on pinterest

user2954876we are developing a website similar to pinterest.com and i am a bit confused as to how to implement follow board feature that pinterest has in our website. We are developing webpage in PHP. I appreciate if you can help me with this or tell me the place where i can get help. Thanks in advance

0
Q: How to add a jQuery validation plugin in to zf2

ShenCan we add them into the layout.phtml? How can we initialize the validation object?

0
Q: mysqli_real_escape_string() isn't functioning properly

kaiserphellosI have the following PHP function: public function signup() { $mysql = mysqli_connect(HOSTNAME, USERNAME, PASSWORD, DATABASE); if (mysqli_connect_errno($mysql)) { $this->viewModel->set("pageTitle", "Signup"); $this->viewModel->set("message", "There was an ...

0
Q: php foreach loop & associative array

KozbotI have a code that gives me exactly the right output, but I keep getting errors during the process, and I'm not allowed to use @ to stop the errors. :( $som = ''; foreach ($prizeStr as $som=>$ptext) { $Cloth = $AssocArr[$som+1]; //doing something else here etc... } I have an array of prize mon...

0
Q: Not getting an array as result (calling a webservice by AJAX-JSON)

PasargadI'm trying to get the result of my web service as an array and then loop over the result to fetch all of the data; what I have done so far: In my web service when I return the result I use return json_encode($newFiles); and the result is as following: "[{\"path\":\"c:\\\\my_images\\\\123.jpg...

0
Q: PHP Mail sending to external e-mail addresses but not internal

user2954893Started off with e-mails not being sent at all, but then I used the "-f" parameter in the function, which then works to send to external addresses (Gmail and Hotmail tested so far) but it won't work for addresses that are on the domain though.

 
4:08 AM
0
Q: wp_enqueue & youtube API on different templates

vytflaI'm trying to use the youtube API on two of my template pages. Obviously I want to enqueue it correctly. When I put this code in my footer.php page, I got it to work: <script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script> <script src="http...

0
Q: using Document.get elementbyid

Kiran RSSubject:- VAlidation is not working by using document.get element by id. I have the following javascript code in my page. <script type="text/javascript"> function validate(){ var name=document.getelementbyid("send"); if(name==""||name==null) { alert("Please enter your name") return false;...

0
Q: Returning more then one row from DB

Jess McKenzieAs you can see in my code below I am using ->row()->$db_field;. I somehow need to manipulate this so I can return $db_field and $db_field1. What do I need to do to be able to return both rows? Code: if ($query_country->num_rows() > 0) { return $query_country->row()->$db_field; }

0
Q: How to show invisible buttons after clicking on checkbox in php?

Sumit RathoreI am using php to connect to a database and show all rows of a table as a table on a webpage. Now what i want is to have a checkbox and a hidden button in each row so that when i click on a checkbox in a row then corresponding button of that row become visible and when i click on that button the...

0
Q: Executing Python Script with PHP Variables

MicahI am writing a simple application that uses information from a form, passes it through $_POST to a PHP script that executes a python script and outputs the results. The problem I am having is that my python script is not actually running with the arguments being passed in. process3.php file: <...

0
Q: Php reading Foxpro DBF file

Georges C ZinhoI need to do a record search and display in a Foxpro dbf file using PHP. My dbf file name icitem.DBF, i am using ODBC and OLEDB methods but both return errors. Method 1: I manage to install the foxpro ODBC driver and create a system DNS, below is my php script and output. php script: $odbc = o...

0
Q: PHP writing into text file while looping

sravisI'm developing an app where user upload excel [.xlsx] file for dumping data into MySQL database. I have programmed in such a way that there is a LOG created for each import. So that user can see if there is any error occurred and etc.. My script was working perfectly before implementing the log s...

0
Q: Zend Framewrok 2 return ViewModel not working

yunhasnawaI created a Zend Framework 2 admin website based on Zend's Album example. Everything works in HomeController which is acted as my default controller. However when I created another controller, the view won't loaded. This is my code in indexAction. class UserController extends AbstractActionContr...

-2
Q: How to better scrape YouTube URLs from site?

JasonI'm trying to get a list of YouTube URLs by scraping the URLs from a site where people generally post them. I enjoy the content posted so I'd like to automate it and watch the videos later. It's just something fun I'm trying. Here is what I have so far: <?php $website = file_get_contents('http...

0
Q: GAE php "urlfetch error"

user2954939i want to get a webpage content via my gae php application. but the code doesn't work. my code is: echo file_get_contents("http://www.navyfield.com", false); and i tried my code on php-minishell,http://php-minishell.appspot.com/ it didnt work either. here is the result Google App Engine/1.8...

0
Q: Grails, how to fill a form from database?

user2954933i'm doing a Grails app for school but i'm having some trouble. What i need to do is, (form a DB called students) fill a form with: ID (user will provide this one) Name (from DB) Specialty (form DB) i don't really know if this can be done whit this: Filling a form in JSP with ajax thank you in...

0
Q: Getting radio selection in PHP returns on not the value

user2954911I am trying to get the value of the selected radio button using php. But when I try to echo the value of the radio it returns 'on', no matter which radio button is selected when I submit the form. HTML: <legend>Question 2</legend> <p>Where was CoffeeScripts first stable build announ...

0
Q: PHP can't pick up file

AndrewI've been trying to create a registration form that requires students to upload documents at the very end. However, after picking up the form values via jQuery, the PHP document can't seem to pick up my uploaded form. Any ideas? Form: <form id="joinUs" enctype="multipart/form-data" method="p...

0
Q: How can I use inheritance with PDO?

NicoI need to build a microframework. I have a generic model where the real models would inherit from. How can I inherit a sql query like "select * from table_name" using pdo knowing I can't bind the query's table name? I hope I've explained myself, thanks.

0
Q: Can I used memcached selectively?

OC2PSHow does memcached really work? If I have 5 different Percona MySQL databases d1, d2..d5, each serving a different PHP application a1, a2..a5 respectively, then can I just try to boost d1 with memcached? I understand that memcached changes a lot and that in order to use it, I'll have to "tweak...

0
Q: Showing fatal error call to undefined function _e() in wordpress

MelvinPlease help me out I have added a search box widget to my site http://www.immostwanted.com. And when I am trying to search some item it is showing the error as Fatal error: Call to undefined function e_() in /home/spencerj/public_html/immostwanted.com/wp-content/themes/proreview/search.php on li...

0
Q: PHP OCI error oci_bind_by_name

LireoecI have been trying to get this function to work, for context it is meant to be a session fetcher for my online store. It keeps erroring out on the oci_bind_by_name line. I was wondering why this is the case and possible solutions to this problem. function getSessionID($customerID) { global $...

0
Q: aligning images and its details side by side in shopping cart

user2934937I am developing a shopping cart. In the first page I have to display all the items.I have to display item's image,price and a link to vie about its details.I need to display the items and its details side by side. Just like online shopping cart sites. Can you please help me. I don't need a slider...

0
Q: Add 'textarea' Field Product Opencart

Ashish VermaI need to add a custom field 'textarea', same as Description with CKeditor in products. Steps I have followed: Created a column 'contents" in product table through following sql command: ALTER TABLE `product` ADD `contents` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ; File: a...

 
4:56 AM
0
Q: Ajax how to disable div or item

user2434677Im new to ajax, is there away you can help me, how to disable all items once click is successful: here is my code for ajax: if (!parent.hasClass('.disabled')) { // vote up action if (action == 'click') { alert("test"); }; //how do i a...

0
Q: Studio is not working in Sugar 7.0

user2955009I am newbie to Sugar 7.0. I am trying to open Studio but studio is not working, it only display the nothing. I have searched alot, but not found any solution. Can any body tell me that whats the problem with Sugar7's Studio ? Thanks

0
Q: sending checked box values to php script to process via jquery

saintI have a table with four columns with a checkbox at the end of each row. I would like to know if there is a way of writing a jquery function that will select all the values of each row when the check box has been ticked and the submit button has been clicked.. and then pass the values to .php fil...

0
Q: How to get etra json data from the server using JQueryUI autocomplete after selecting an item

user2944805after selecting an item on the returned results, how do i alert another item from php? here's plugin settings. $(function() { $( "#SearchInput").autocomplete({ source: '../Search/BP_Search.php', minLength: 1, autoFocus: false, select: func...

0
Q: PHP Login Page Redirect

user2896254this code is incomplete and I need it to redirect to a page called mainpage.php with hardcoded information for the username and password. Here's the code. <?php session_start(); $username="user"; $password="123"; if($_POST['username'] == $username && $_POST['password'] == $password) ?> <html> ...

0
Q: Php not parsing new line in variable obtained from GET request

user2954995I am writing a plugin in which I need the user to be able to download a csv created on the fly (I don't want to use up server space). I have the text I need to print to csv pinted in a hidden element in a form, which I then echo and create csv using fopen and fclose. The problem is that new line...

0
Q: JSONException:Android Can't connect MySQL and PHP

George EdwardJAVA Code: ![protected String doInBackground(String... args) { // Building Parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL JSONObject json = jParser.makeHttpRequest(url_all_products, "GET", p...

0
Q: Send Javascript variable to PHP to be saved to DB

user2872697Hi I am new to PHP and javascript, am unable to send a variable from Javascript to PHP page. My Javascript code is separate .js file where I have declared a variable count which incremented at each correct answer that user gives. I wanted to pass this data to PHP page so that I can save it to dat...

0
Q: php mass mail get blocked by gmail

shanavasWe want to send mail to our 5000 users about their account details every day We are using php CodeIgniter mail function to send mails with loop Now our users especially gmail are not receiving mails, We are getting mail logs as gmail has temporerly blocked our ip Someone please help me how We c...

0
Q: how to connect to different ip address using php socket programing

Rincy Raphaeli am running wampserver in one system and its ip address is 172.16.127.105. i took this as my server and run the server program server.php as { // set some variables $host = "172.16.127.105"; $port = 25003; // don't timeout! set_time_limit(0); // create socket $socket = socket_create(AF_IN...

0
Q: I need to match all characters in a group as long as they don't match a certain word

Fred GarbuttI'm not sure if this is a simple question, but i have been unable to find an answer to it thus far. I am trying to write a regular expression that pulls apart a .docx file and matches replaces all <w:tab /> tags with <w:ind /> tags, as the <w:tab> tags don't seem to preserve tabs correctly when t...

0
Q: multiples INSERT INTO SQL and PHP

user2955030$DEVICE_REQUEST_ARRAY = $_POST['DEVICE_REQUEST']; foreach ($DEVICE_REQUEST_ARRAY as $value_set) { foreach ($value_set as $key=>$request){ echo $key ." ".$request."<br/>"; $query = "INSERT INTO master_request_devices ( '{$key}'...

0
Q: who does PHP's YIELD->send() works?

learning phpfunction yielding() { for ($i = 0; $i < 10; $i++) { var_dump(yield); } } $y = yielding(); foreach ($y as $val) { $y->send('foo'); } output: string(3) "foo" NULL string(3) "foo" NULL string(3) "foo" NULL string(3) "foo" NULL string(3) "foo" i expected the output to be: 1...

0
Q: RegEx to process and change multiple links in a string

marcnycI am having a hard time figuring this out: I have a string ($data) which contains some links formatted this way: [pagelink]Folder/File[/pagelink] The $data contains multiple of these links. I need to replace these links with actual html links and I have this code to do it (which works): $da...

0
Q: how to show square root symbol in php code using gd library?

Kiran RSI am now dealing with a mathematical problem with my codes. I have second degree equation , for example , ax^2+bx+c=z . If we have to find the value of 'X', we have the eqution , x=(-b +/- root(b^2-4ac))/2a. The main heaach is i've to show the square root symbol in image using gd library. But i...

0
Q: The appropriate way to securely use flash in webpage

Thanos DarkadakisI will start with an intro to prevent you making specific questions. Introduction I have no idea about flash programing. What i do know, is that when i browse a page that contains a flash object, i can somehow save it in my computer. I just want to know (before i start learning flash coding) if...

0
Q: Internet Explorer cannot display drop down menu properly

niaizahraWhen i run my project in IE8 my drop down menu in navigation bar seems not working properly as in Chrome and Firefox. Its appear in bullet forms that line in the left side of the page.See the image below. This happen when i try to alter the URL of my existing website. I put all my php file ins...

0
Q: PHP special names - simple explanation needed

cactusboatCan someone please explain how i would answer the questions below, simply, so I am able to work it out myself. I have the questions together with their answers at the bottom. Consider the following code and complete the incomplete entries in the table: <?php class Employee { ...

0
Q: Extend ModuleAdminController Add/Edit not working

Amb3rL4nnSo this seems really dumb question maybe and basically a text book implementation. But when using the Add/Edit buttons created by the renderList() the submitted fields are empty. I have gone into the core ObjectModel class and output the results and indeed no data is passing back. From what I ...

 
5:38 AM
0
Q: php form post not sending email

Michael McLaughlinSo I was able to get the user all the way to the thank you page, but when I check my email (which is correct in the real code), I had nothing. any help would be appreciated. <?php $myemail = "myEmailInAString@gmail.com"; $name = check_input($_POST['full_name'], "Enter your name"); $phone = che...

0
Q: Why does php md5() always different from python's hash.md5() if using chinese character?

ruibinhere is my php code: $str = '你好'; $input_encoding = mb_detect_encoding($str, array('ASCII','GB2312','GBK','UTF-8'), true); echo sprintf('input encoding:%s', $input_encoding); $str_gb = iconv($input_encoding, 'GBK', true); echo sprintf("utf8 encoding:%s\n", $str); echo sprintf("gb encoding md5:%...

1
Q: PHP Class not echoing properly

TrauliaSo im in the process of learning php and classes is giving me trouble here, this code if im not mistaken should echo out Blue and Dusty but for some reason it is sticking to the default green <?php class World { public $color = 'green'; public function __construct($color) { $this->$colo...

0
Q: Passing PHP session to different folder

user2955076how do you pass a PHP session value to different folders? I have this index page in the localhost. localhost/index.php <?php session_start(); $_SESSION['Username'] = 'Hello'; header('Location: ../AnotherFolder/index.php'); ?> In here, I want to echo the $_SESSION['Username'] on other s...

0
Q: php's FINALLY is for Uncaught exception?

learning phpFor what is can see, the only difference between putting code inside finally block and outside finally block is that the code inside finally block will be executed when if there is an uncaught exception while code after try-catch-block that is not inside finally-block will not be executed. am i c...

0
Q: Php syntax error confusion

jayadevkvI have been using php simple image libraray for image manipulation quite a while(and never come across this error before). Now the script stops throwing a syntax error when the code is put online and there is no error occurring in the local server The error that shows: **Parse error: syntax e...

0
Q: yii grid does not follow page size

EnricoI have this typical search in yii. All works well except that the grid view does not display all the results. the headers says "Displaying result 1-2 of 6 results" although the page size in dropdown is set to 20. here's my dataprovider public function search() { // Warning: Please modify ...

-1
Q: How to center username and password textbox

user2896254I'm trying to get the admin login to center in the middle so that it looks better, here's the code. <?php session_start(); $username="user"; $password="123"; if(isset($_POST['username']) && $_POST['password'] == $password) { header("Location: mainpage.php"); } else { ?> <html> <head> ...

 
6:08 AM
0
Q: PHP include statement different between servers

tPlummerWorking on a win2009R2/IIS7 server, this php include statement was valid: include('/path/file.php'); Moving over to a shared Linux CPanel server, it is not. I have to instead do this: include('path/file.php'); When I first wrote the code, I was under the impression that the opening / meant...

-2
Q: I am getting error Can't connect to MySQL server on 'Host ip address' (110)

RedSunI am getting error "Can't connect to MySQL server on 'Host ip address' (110)" I am using FileZilla Client and phpmyadmin

0
Q: SwiftMailer Help - PHP Contact Form w/ File Attachment

712JeffersonTrying to do something seemingly very simple: write a script for a contact page that allows the user to input a few basic lines of info, attach a file and e-mail it to a fixed address. My, how this has turned into such a headache! Here's the page in question: http://www.starcrestescrow.com/form...

0
Q: Remove .php extension is not working

UserProgI found a lot of tutorials and questions regarding to removing the .php extension in the URL. I have tried a lot of examples and until now it is still not working. This drives me crazy. I also want to put trailing slash at the end of the URL but first I would like to achieve this first. Currently...

0
Q: no-www url for sub-directory/sub-domain

Raj ツSay example my domain is http://www.domain.com and i wanted to redirect into no-www url (http://domain.com), for that i used this code in .htaccess RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] It's working fine http://www.domain.com redirects to http://do...

0
Q: how to use javascript in php when there is a header?

mishir.aliif(($row["status"])!="valid") { $stats=$row["status"]; echo "<script type='text/javascript'>"; echo "alert('Your Status is $stats..Please Try Again Later...');"; echo "</script>"; header ("location: index.php"); } it is a part of a php code. if i use // before header, javasc...

0
Q: i m having caution of Deprecated: Function eregi() is deprecated in url code

saiyyedfardeenhttp://fastseoindia.com is my site... on below link http://fastseoindia.com/tools/robots-txt-checker/ when you insert your website link... it will show you your site's robots.txt but will give error on top... Deprecated: Function eregi() is deprecated in /home/hjlhvqyy/public_html/fastseoi...

0
Q: Php doesnt execute when coming from window.location

user2509768I have a php file named "savegame.php". I use xampp. When i enter "localhost/morabaraba/savegame.php" as a url manually it works i have a file "index.html" in the same folder as my "savegame.php" file and using window.location = "savegame.php" redirects to c:\....\morabaraba\savegame.php but it...

0
Q: I want to select record multiple key with like

shaktiI want to select record from table with key.My code is working but it's not select all record regarding Php and Mysql it select only PHP,Mysql record. My code is $skill=PHP,Mysql; mysql_query("select * from tablename(skill) where fieldname(key) like '%$skill%'");

0
Q: Heroku Scheduler and PHP

PoochI have seen many instructions using Heroku Scheduler , but none explain how to use PHP with it. Would anyone have a good example of PHP being used with the Heroku Scheduler? I don't want to be pointed to something that isn't with PHP, since all the replies i saw to similar questions did not show ...

0
Q: Postgresql 8.3 "shadow user"?

MuhvI have currently online working system (SunOS 5.10 i386/PostgreSQL 8.3). Now i need to create new "shadow" user who has read-only access to same data as working system from other server (Ubuntu/PHP). netstat shows that postgres listens all netw. interfaces. Unfortunately I dont have any experie...

0
Q: Echo to another page

user2896254How do I get the input from this textbox to show up on another page called mainpage.php. Here's the code for the form that I want outputted onto the mainpage.php <form action="" method="get"> <b>Bio</b> <br> <textarea rows="5" cols="20" name="result" value="result"></textarea> <br> <input type="...

0
Q: Fatal error: Call to a member function prepare() - On call function more one times

user2594631I have a problem on call this function more one times Index.php <?php function check_status($id){ require_once ('inc/connect.php'); try { $query = $db->prepare('SELECT `usage` FROM `room` WHERE `id` = :id'); $query->execute(array(':id' => $id)); $row = $query ->fetch(PDO::FETCH_NUM); }catch (P...

0
Q: PHP Email Pixel Tracking Not Firing in Yahoo Mail

MicahIn order to track email open rates, I'm firing a pixel in a mass email I'm sending from my server. The script is working in Mac Mail and Gmail email clients. The email is received and the pixel is downloaded. However, it's not working in the Yahoo mail client. The email is received, however the...

0
Q: Preg Match checking in PHP

WarriorI have pattern like this 'D34566'. how i can check this pattern contains in the given string. String = D34566-Test Case. Pattern = D followed by 5 digits. i.e A word starting with D and followed by 5 digits.

0
Q: any way in PHP to access the KEY of YIELD outside FOREACH?

learning phpIs there a way to access the KEY of the YIELD or it is acceptable only through foreach loop? function foo() { yield 'bar' => 'baz'; } $foo = foo(); foreach ($foo as $key => $val) echo $key; // output: bar $foo = foo(); echo key($foo->current()); //Warning: key() expects parameter 1 t...

0
Q: mail gt marked as spam by gmail, any solutions?

Rickyi am using php code to send a mail with an attachment in my web application. all are working fine expect gmail marked it as spam. my code is look like below. move_uploaded_file($_FILES["file"]["tmp_name"],$path . $_FILES["file"]["name"]); $filename = $_FILES["file"]["name"]; ...

0
Q: English to Arabic conversion in buddy press

Kiren SivaI want to translate English to Arabic in wordpress (buddy press). In php $reason = __(sprintf("Wave limit has been exceeded for today, you can wave %s tomorrow",$user),"buddypress"); In buddypress.pot #: wave msgid "Wave limit has been exceeded for today, you can wave %s tomorrow" msg...

0
Q: PHP session_id() refresh on every request, $_COOKIE['PHPSESSID'] empty

user2780294I can't figure out why, but tried all answers/google.. I found nothing. Here's the situation: Localhost code session_start(); echo session_id(); print_r($_COOKIE['PHPSESSID']); Result: Consistent session_id() across app pages, and on page refresh. $_COOKIE['PHPSESSID'] matches th...

0
Q: Session randomly expire and logs out SOME of my users

Marcus LindI'm having issues with users of my website complaining about getting logged out automatically multiple times while using my serivce, however I can't reproduce the error and the issue does not seem to effect every user, since I have hundreds of users that is using the service fine without complain...

0
Q: PHP sort assosiative array by key

user2629419I have a associative array in the following format: How to sort the array by 'c_name' in ascending order Array ( [country_detials] => Array ( [0] => Array ( [c_id] => AD [c_name] => Andorra ...

0
Q: Ajax call on yii dialog box close function fails

not.your.ordinary.girlI have this problem with using ajax call on dialog box close function. Here's my ajax call function: function samplefunction(var1,var2){ $.ajax({ url: "controllerFunction?var1="+var1+"&var2="+var2, type: 'POST', dataType: 'json', success: function(data)...

0
Q: why does the it displays the php file as text?

user2955204i know this question has been asked befor but i really didn't understand anything out of the answers. i don't know much about php i just wanted to connect my html website into a php file that will save all the password into a text file. but when i enter a random password and it directs me into th...

0
Q: Need a help on logs with codeignitor?

tpdevI have used code ignitor framework.Have used its log part. I had a query regarding configuring logs in the application. As per the documentation they say that we can configure in app/config/php and filter the logs as debug,error or info messages. But even after doing that, I am not able to filter...

-1
Q: Saving to MySQL TIME and DATE data types through PHP

JRulzI need to store date in DATE type and time in TIME type in a MySQL database table. I have found many ways such as formatting and converting from unix time etc. but whats the most straightforward, simplest way to create data to store as DATE and TIME types in MySQL when using PHP.

0
Q: Use a trait conditionally in PHP

MouliI want to use a trait in a class, only if a condition is satisfied. For example: trait T { } class A { if ($condition) { use T; } } I know I can't use if directly in class. So, I'm looking for a way to use traits conditionally similar to the above. Is it possible?

0
Q: Object not found! codeigniter control

gabrielhy all, can you help me friends... I get error : if(count($q_cek_login->result())>0) { foreach($q_cek_login->result() as $qck) { if($qck->ID_JABATAN==1) { foreach($q_cek_login->result() as $qad) { $s...

0
Q: log4php logger's additivity

Shivan RaptorIn log4php configuration documentation, there is a configuration option called "additivity" which stops the inheritance from root loggers. However, I added to the PHP-format configuration file, root logger is still logging the entry that supposed to appear inside logger queryLogger only: <?php ...

0
Q: loading only new data from database instead of loading all data using loop

user2955239I am in the middle of a social networking site. I am stuck in the status update process. I want to show the status when some status update takes place. Is there a way so that instead of using loop to load and show all the status, i load only the new status and previous status remains on the profi...

0
Q: Implementing a html markup with PHP in OpenCart, How?

Gary DapogiNo PHP skills yet, I've just learned HTML/CSS and think I'm already good at it, but still not in PHP. I am developing my own OpenCart Store and also making it as my practice environment for html/css. I've installed a paid module to make a product option as custom product field. I've already set ...

0
Q: How to Implement queue in php?

user2955245I am having data base with contact numbers of users suppose 123,1234,456,123,456,... Now I have 2 callers and I want that there will be queue so that no repeated call will be made. Both the callers are making calls at the same time. In simple both the caller will have distinct contact numbers...

0
Q: custom module routing is not working in magento

rajeevktomyi am a beginner in magento. I have added a custom module and made routing for that custom module. however it is not displaying anything at all, showing a blank page!!!! Not even the page not found message. here is my code.. my config file is as follows app/code/local/Test/Test/etc/config.xml <c...

0
Q: php display data in div, h1, ul using while loop

user1462863I am not very good in php and mysql but based on my code, I am able to display the results that I wanted but, it is not displaying in the right DOM structure. I would like to display like below: <div class="container"> <h1>Header</h1> <ul><li> <p>data 1</p> <p>data 2</p> </li></ul> </div> <div...

0
Q: Laravel 4, default Email queue priority

Marek SzymeczkoI've configured Beanstalkd for my Laravel 4 application. I've got two queue events I need to handle. One is some calculation for each user (one calculation per user) and the second one is mailing. The question is, do I have to implement Queue priorities? Or does Laravel 4 have those things hand...

0
Q: PHP not properly passing UTF-16 String to Python

MichaelMitchellI am passing a UTF-16 String from PHP to Python, the String comes in from a header to PHP, then is passed/executed with this: $mystring = system( "python test.py {$_SERVER['HTTP_EVE_SHIPNAME']}" ); The header being {$_SERVER['HTTP_EVE_SHIPNAME']}. My Python code: import sys shipName = sys.arg...

-1
Q: How to save Facebook Post ID to mysql database?

Jben KayeI have a program (an app) which ask for user input then generate an image and post the image link to FB timeline. now i want to do is to get the POSTID and save it to my database. so i can have a record which i can retrieve if ever i want to connect to the FB POST. how can i do this? below is the...

0
Q: Execute a line of php before ajax submission

Greg LI have a function in wordpress that handles the uploading of files to the wordpress image gallery. After converting the form to ajax, I realized the file upload no longer works. The thing is, if I could just get the function to execute before the ajax it would work. Here is the code: function ...

0
Q: Store Cached image path in Sqlite database

David KimzI can download images from the web and save them to Cache, now I need to store their path in SQLite Database. Any help please !! thanx in advance. Below is my code Snippet with help from http://www.androidhive.info: //Saving Cached Images to File E_Meges...

0
Q: How to loop the input type text?

user2901740How can I loop the input type text so that it can have it's own unique attribute eg. name, value. What I mean is that for example name="text1", name="text2",. Something like that. Here is my code. Thanks :) <HTML> <HEAD> <TITLE></TITLE> <SCRIPT language="javascript"> function add...

-1
Q: How to return constant value from string in php?

Jobaer ShumanHere is constants: define('Qc', 1); define('D1', 1); define('D2', 1); define('S1D1', 1); define('E1D1', 1); define('E1D2', 1); define('An', 1); define('D3', 1); Formula comes from database: $formula = "Qc + D1 + D2 + S1D1 + E1D1 + E1D2 + An + ...

0
Q: php mail to send a PDF attachment and receive a confirmation message

J HI'm a relative novice trying to write code so that: 1) a user can fill in a form with their email address and (optional) their name and a message body 2) I send them a reply message automatically with a pdf they requested 3) I get an email with their email address (and name and message if they...

0
Q: file type upload is not working on windows 8 phone?

Bhattiwhat is the alternate of input type file for windows base mobiles, i can see the browse button but when we touch on browse button nothing work. Ref to: http://viljamis.com/blog/2012/file-upload-support-on-mobile/ *what is the quick solution to replace input type file * My Code <input id=...

0
Q: Does loadHtmlFile php function sends ip address of the web server to the target website server?

Zahid RainSuppose my website is mywebsite.com and collecting data from remotewebsite.com I am using loadHtmlFile function to load data from a remote website. The page I am accessing is dynamic and I am calling loadHtmlFile every 3 seconds to get the updated data via ajax call. My concern is, the website o...

0
Q: Issue with binary operation in PHP

sourcecodedecbin() converts decimal to binary , also 1 XOR 0 = 1 so , decbin(0) ^ decbin(1) should give me 1 but it is giving me nothing .... why ?

0
Q: PHP SOAP WSSE Error

RobI've been attempting to auth using WSSE headers. I've found a lot of useful information on this site so far, but still have not been successful yet. I need to send headers like such: <soapenv:Header> <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oa...

0
Q: Deprecated: Function eregi() is deprecated in class.kValidate.php file

saiyyedfardeen Deprecated: Function eregi() is deprecated in /home/hjlhvqyy/public_html/fastseoindia/klib/class.kValidate.php on line 107 Deprecated: Function eregi() is deprecated in /home/hjlhvqyy/public_html/fastseoindia/klib/class.kValidate.php on line 109 Deprecated: Function eregi() is deprec...

0
Q: ip4 and ip6 convert in different way

wervaI want to store ranges of IPs into database. The problem is that some IPs are ipv4 and some ipv6. I want to convert all to ipv6 then store into database. for example: according to converter: 192.168.1.100 => 0:0:0:0:0:ffff:c0a8:164 What makes problem is that php treats them in different way...

0
Q: "likes for comments" database designing?

Srii have database tables for Posts and comments. i want to allow users to put a like or dislike for each comments and posts. so..i have few ideas of doing this. please tell me either i am correct or not. create two additional columns in comments table. likes | liked_uids if a person clicks on ...

0
Q: How to add sortable columns in a Joomla component (table), both ASC and DESC with an arrow

KelvinI have followed through the tutorial, http://docs.joomla.org/Adding_sortable_columns_to_a_table_in_a_component When I have followed all instructions there, I was able sort the columns, but with only ASC direction and there is no arrow indicator. Does anyone happen to know how to enable both ASC...

0
Q: MySQL: Updating a Field With The Same Value

Michael RichI use the below method to update a field comment_confidence in my comment table. public function update_comment_confidence($confidence_score) { $this->db->update($this->_table, array('comment_confidence' => $confidence_score), array('comment_id' => self::$comment_id)); if($this->db->aff...

0
Q: How do I get numeric values in an array in str_replace()’s search parameter to map the way I expect?

binkiphp > echo str_replace( array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'), array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p'), '01234567890abcdef') . PHP_EOL; klmnopghijkklmnop I expected this str_replace() call ...

0
Q: Fatal error query codeigniter

gabrieli have query, but it's error ...why? can help me?? $tot_hal = $this->model_welcome->manualQuery("SELECT * from tbl_transaksi a left join tbl_pelanggan b on a.id_pelanggan=b.id_pelanggan left join tbl_karyawan c on a.id_karyawan=c.id_karyawan where a.status_transaksi='OK'"); error : Fatal erro...

0
Q: Like or favorite a post with unique user using Laravel Eloquent

Sagiruddin MondalI was creating a like system for my website. in this I wanted one user can only like one time for a post. and a post can be liked by many user. Also many user can like many post. So if I guess it right, It is a many to many reletionship. in this context, I create the following table ... user...

1
Q: Need suggestion to edit a php through php

YadheendranI have a config file which is written in php as below, <?php class WebConfig { public static $WEBPATH = '/customers'; public static $ACCOUNTPATH = '/empaccountpath'; public static $INFO = '/accountInfo'; const ACCOUNT_STATUS = '/account_status'; const ENABLE_SEARCH = '/enable...

0
Q: Move position of MySQL row up/down using php

FaisalI'm fetching my page's menu from MySQL table as an unordered list <ul></ul> ORDER BY their position, Here is my MySQL table's screenshot All I want is a query when I fetch record of page_id_pk=3 and SET its page_position from 3 to 2 and UPDATE it so now it holds page_position 2 and rest of t...

0
Q: kendoui grid CRUD example

user2313172I'm new to KendoUI. I'm developing an app using the Grid with CRUD functions. It is for a relatively simple application for a few columns (10) and rows (25). I managed to make it work for Read and Update. But I don't know how to code it properly for Create and Delete. I cannot find examples with ...

0
Q: Set userprefs when loading a gadget in PHP

thekman30Greetings from a long time reader, I am wondering if anyone could give me an example on how to set the UserPref of an XML Gadget using when loading it in PHP? So far I have managed to make the gadget display by iterating the the tags until finding the content tag, then echoing out the code betw...

0
Q: PHP get_result() with mysqli prepare not working

AkilanI am trying to implement php mysqli prepare in my existing source. To fetch "select * from " I used object oriented method. Its working fine in my local server. When i deploy into server, it will not show the result or error. It breaks after the get_result() function. Here is my source, $mysql...

0
Q: Cant find base path for bundle

DavidI'm using Symfony2 and want to generate getters and setters for the entities by running: $ php app/console doctrine:generate:entities TestBundle The Console returns me the following message: [RuntimeException] Can't find base path for "TestBundle" (path: "C:\xampp\htdocs\ProjectX\src\Nam...

-1
Q: Increment time by 15 minutes in php

ashwinbhyIn mysql database we have a column of type time we need to increment the value of time by fifteen minutes in our php code. for example time is 09:45:00 it should become 10:00:00

0
Q: Syntax Error, unexpected $end -- PHP error, what's wrong?

user2955368My entire error code is Parse error: syntax error, unexpected $end in /home/a3704125/public_html/home.php on line 356 Here is my entire PHP file.. Tell me what the problem may be? ._. Thanks! <?php define('INCLUDE_CHECK',true); require 'connect.php'; require 'functions.php'; // Those two fil...

0
Q: PHP Files work in one setup but not in another

zack_falconI've recently made a new Fedora setup, consisting of Fedora 19, Oracle 11g, Apache 2.4.6, and PHP 5.5.4 (afaik). My objective is to migrate an existing PHP setup from one aging PC to this new one. As far as I know, I have everything correct, sans PEAR*. Now, I've been able to create an info.php ...

0
Q: PHP - Replace subfolder in link (in order to change language)

AndyThis is my first post on this forum, so please forgive any of my unintentional errors. So, let me try to explain what my problem is: I have a two language website with a folder structure like this: mywebsite/ru (russian) and mywebsite/en (english) When I'm on the russian version of the websit...

0
Q: How to use document.write() into .html()?

Boris KuzevanovI know that question is a little stupid. But i have next problem: I do obfuscation of my HTML code by http://myobfuscate.com/ , as you can see this site do like this: he creat varriables and put on it JS code. Here is code like this: var lOOL = 'document.write()'; than it print on page by eval...

0
Q: MySQL database timezone isn't being set correctly - why?

Andrew PhillipsI have a MySQL database hosted via a Cloud service provider. The timezone is different to my local timezone. I'm trying to set the timezone correctly .. Here's my PHP code I'm using when I want to get a new connection to a MySQL database: static function get() { if (self::$instance!=null) ret...

0
Q: Deprecated: Function ereg_replace() is deprecated in line 114

saiyyedfardeen Deprecated: Function ereg_replace() is deprecated in /home/hjlhvqyy/public_html/fastseoindia/klib/k_functions_text.php on line 114 code is below: $value = ereg_replace("[ ]{2,}"," ",$value); // line 114 plz help and give me a real code.... i can't understand full code that's why i pos...

0
Q: URL specific encode

d.raevI try to recreate a URL but can not find the encoding function $input = "2/3*( ((word*888) )>(word2 AND ((word3*888))/word4>888"; $encoded = "2/3*(%20((word*888)%20)%3E(word2%20AND%20((word3*888))/word4%3E2888"; Tried with urlendode, rawurlencode but they replace the brackets and "*".. The ...

0
Q: How to maintain visitors history using cookies with php

Vky ArainI wants to find the visitors history with cookies untill cookies doesnot expires, if iam setting a cookie on my page and when visitor visits my page and coming back to site before cookies time period expires and visitors visits my inner pages and search anything, how i maintain visitors history w...

0
Q: Recursive SELECT query in Mysql

leo wongI got two following tables category:(one to many-----question) id name parentId 1 test1 0 2 test2 1 3 test3 1 4 test4 3 ..... question: id title category_id 1 question1 1 2 .... 1 3 .... 2 my question is : if i search category id = 1 ,there will be...

0
Q: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource -- What do I do with this error?

user2955368Here's what the code states: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a3704125/public_html/home.php on line 117 Here is my entire PHP/HTML code: <?php define('INCLUDE_CHECK',true); require 'connect.php'; require 'functions.php'; // Those two file...

0
Q: td colspan not working for tr with ids

NitishI have a table structure similar to below: <tr> <td colspan="5"> TEST </td> </tr> <tr id="abcd_<?php echo $id; ?>" style="display: none"> <td colspan="5"> <span id="hidtb_<?php echo $id; ?>"></span> </td> </tr> The table is within a loop and the value of $id c...

-1
Q: How can i setup an online photo frame editor that produces photoshop file or compatible one for me to process?

user2955412I want to develop something like this website has: http://www.mycustomcase.com/iphone4/photo_case (select 1st option displayed on left and you will find an online case editor) I want to understand the mechanism used in it, i know it is a combination of lots of tools but i want to know how is th...

0
Q: CssEmbed generates exception on bootstrap_less file

KdgDevI'm currently following this tutorial: https://www.youtube.com/watch?v=5om81wXYIns It's about learning Symfony 2.3, and right now is demonstrating how to set up Twitter Bootstrap and also how to use assetic with cssembed, to compress all css and javascript code in to 1 file each. I'm working on...

0
Q: Selecting between 2 specific elements to get comments between closing and starting tag

Leo PflugI'm currently trying to fetch the data of a simple XML-Sheet which contains data for translation use it's structured like this: <string name="action_settings">Settings</string> <string name="action_error">Something went wrong.</string> Sometimes there are comments after to describe the conten...

0
Q: Magento - Store switch and cookie based redirect

user2955437I have a website with stores in english and italian. When we change the store, the product URL changes - 1 URL for english product page and 1 URL for italian product page. English store is the default store. The switch works but when I go directly to the italian product URL I'm redirected to a ...

0
Q: Installing phpunit via pear on Windows

ArfeenI have already setup pear on Windows and its working fine. I wanted to install phpunit but seems like the repository is returning 403 forbidden response(Channel discovery added already). Is there anything I need to do before installing phpunit ? c:\wamp\bin\php\php5.3.13>pear install --alldeps...

0
Q: Authenticate a PC before running my website

Qadir HussainWell, Let me describe some information about my work I m making an web application, its a kind of some online shop using PHP, jquery, ajax and JavaScript. My intention is may be strange , i.e I want to launch my site on only one PC on local host. How should i set my site so that it only run...

0
Q: How to use ajax to update database table?

Sumit RathoreI am showing a table on a webpage using php and mysql. I have added a chackbox in each row. Clicking on the checkbox will result in displaying two buttons in the row whose checkbox we clicked , one is delete and other is edit. For this purpose with the help of stack overflow i used jquery. Now wh...

-2
Q: Unexpected behaviour of mysql at different times

pradeeppsWhen i execute my program,arises an error exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens', after few seconds i recreated the same situvation with out changing code..then it execute properly.What may be t...

0
Q: Best way to get output from another PHP file as a variable

IsaacLI need to include the output/result of a PHP file in another file. I found info online about using curl to do this, but it doesn't seem to work so well, and so efficiently. This is my current code: function curl_load($url){ curl_setopt($ch=curl_init(), CURLOPT_URL, $url); curl_setopt($...

0
Q: Write code to log in, auto populate fields and submit actions?

PomsterI need to write code to log onto a site with the username and password and then find all the fields that match and populate them with my data, then have this code submit this action and then log out. I have no idea what this type of coding is called or where to start looking how to preform these...

0
Q: handle with images in php

Zubair Haiderhow insert picture into DATABASE using PHP and then upload again on page from data base using PHP . recently I have inserted first name last name and know how to get again from database. but don't know how to handle with images in php

0
Q: Ajax POST and Return the data as json

yogamadnessHello I'm new on ajax i want to make some ajax post that will select data from mysql database based on what user input on ui and show the data as json object, this is my code that not work index.html ` </fieldset> <form id="search"> <fiel...

0
Q: How to secure a php script

Guus van Walstijun I have got a php script. In this script i will be connected to a ftp server, and show a file. What would be the best way to secure this script so can only log in 5 times in 1 hour or something like that? My script: <?php session_start(); $_SESSION["ftp_user"] = $_POST["user"]; $_SESSION["...

0
Q: Scrape longitude and latitude from this html using preg_match

Ben PatonI'm trying to use a regex to extract just the longitude and latitude coordinates from this html. This is just a snippet of the full html from http://www.bricodepot.fr/troyes/store/storeDetails.jsp?storeId=1753 so I need to be able to search through the whole targets page html and match the longit...

0
Q: How to delete an input type text?

user2901740How to delete the specific input text that is dynamically generated? I tried to used the remove() but not working. any idea? var txtLoop = 1; function add(type) { //Create an input type dynamically. var element = document.createElement("input"); //Assign diffe...

 
8:44 AM
-1
Q: Escaping JSON strings but stripping HTML attributes for saving to DB

ExtrakunThe project I am working on allows user to have simple config files which are stored as JSON strings inside a database. The issue now is I wish to escape HTML attributes, but leaving the quotes untouched. If I use htmlspecialchars, all the quotes will become &quot, and the JSON formatting will be...

1
Q: Unable to filter data from mysql

MahouI tried to read data of my MySQL database, I created the fullcalendar and show up the event on calendar. However, it is unable to retrieve the data from my MySQL database. The First php code : <?php require_once('conn.php'); ?> <?php $maxRows_RsCourse = 1000000; $pageNum_RsC...

0
Q: fix complicated mySQL query that fails on multiple users

salivanAll tables and query itself is replicated here: http://www.sqlfiddle.com/#!2/b25f8/7 I run this query: SELECT a.name_surname,GROUP_CONCAT(w.word) FROM words_en w INNER JOIN connections c ON c.word_id = w.id INNER JOIN ( SELECT f1.asked_user_id AS friend_id, f1.created, u.name_s...

0
Q: How to get extra json data from php using JQueryUI autocomplete after selecting an item?

user2944805After selecting an item on the returned results, how do I alert another item from php? Here is the plugin settings. And if there's a better way i can improve my controller, please suggest something with an example. $(function() { $( "#SearchInput").autocomplete({ source: '../Search/...

0
Q: Remove duplicates in a PHP array

user2955522i'm using the Google API to extract data from Analytics. But i can't seem to remove the duplicates in my array. I have checked the forum and array_unique seems to do the trick but i can't seem to get it working. Any ideas? Much appreciated! THE CODE: <?php $jsonurl = "URL"; $json = file_get_co...

0
Q: simplexml update xml file permission issue on ubuntu server

fefeI have a permission issue when I try to update an xml file with simplexml $xml->asXML('my.xml'); and I have been trying to change the permissions on file chmod 777 my.xml but doesn't seems to work. What other alternatives I have ?

0
Q: php getopt() function not giving correct answer

Muneem HabibFollowing is my command line arguments: php a.php -g UAMS ABC Now when I get command from command line using getopt then I am getting only first argument i.e UAMS. I want to get both arguments i.e UAMS and ABC. Following is my piece of code to get argument throug getopt() function. $options=...

0
Q: I want to change the dropdown.selectedIndex to "text" instead of what it currently is "value"

user2955503I have a javascript dropdown on website, here is the code- <?php function get_request_uri_without_page() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["...

0
Q: FPDI class not starting

synan54i want to setup FPDI in my localhost but its gives me an error Fatal error: Class 'FPDF' not found in C:\wamp\www\book\fpdf_tpl.php on line 20 what i did i ust went to download page http://www.setasign.com/products/fpdi/downloads/#p-380 downloaded 2 packs FPDF_TPL and FPDI i unzip that files...

0
Q: GoogleMap getting all data need

user2955539I'm using a standard google map, with assigning the zoom, radius and the long latitude even the category of places, the only thing i want to know is: If it's possible to get all the data by assigning the "LongLat" by there within "500" RADIUS and if i can get all the "restaurant" names within th...

0
Q: Getting error from fdf_get_value()

Mehedee Rahman SetuI was trying to get field value from fdf file. I have used following code, but getting error. <?php $fdf = fdf_open("test1.fdf"); echo "Name: ",fdf_get_value($fdf,"first_name"); fdf_close($fdf); ?> Error message: Fatal error: Call to undefined function fdf_get_value() in C:\LocalServer\htdoc...

0
Q: Javascript username validation check in jqBootstrapValidation.js

Phil HarmonieI'm using jqBootstrapValidation.js ( http://reactiveraven.github.io/jqBootstrapValidation/ ) and I want to check if a username that I choose is already existing. I loaded all Usernames in an array: $array = array("User1","User2",...); and now I want to check if the username already exists whi...

0
Q: Replace Router or Controller in Zend2

bordeuxI want in my module replace mached route with my own, when request don't have specific GET parametr. For example: example.com/ControllerName/Action/?mode=ajax Is mached to ControllerName But when is example.com/ControllerName/Action/ is mached to my controller in my module. How can i do it...

0
Q: I need to fix a function that scan WordPress post for YouTube link and put the link on a single line

user2948145function the_content( $more_link_text = null, $strip_teaser = false) { $append = '&w=480&rel=0'; $content = get_the_content( $more_link_text, $strip_teaser ); $content = apply_filters( 'the_content', $content ); $content = str_replace( ']]>', ']]&gt;', $content ); $content = p...

0
Q: Corrupted File Returned PHP Header File returned from database?

Stevie GI have the following function that gets a blob from the database and should return the file to the browser, however it is returning a corrupt file: $file_data is an array with the returned row from the files table with the blob, the content type, last modified and other such things. $data is th...

0
Q: PHP: Applying multiplication factor to a broad number of values

MaxEvronI'm coding an audio amplifier in order to apply an envelop on an audio track. The audio comes from a file containing raw 44100 KHz 16-bit stereo samples. I coded something like below. In order to simplify the example, the amplification factor is constant but is varying in the real project. <?php...

0
Q: Two forms - one submit button?

michaelmcgurkI have TWO forms on my website. Is it possible when I submit one of these, it will take form data from a particular field in the other form? I am using the Recurly system with PHP. Thank you, Michael

0
Q: Retrieving mysql data on to one php page from multiple tables

N Mahmoud AmryI am developing website which database driven. It has two pages i.e index.php and subpage.php. On the index page there appears 14 links namely about_us,projects,services,partners and among others. And for the case of the subpage.php, it has "a blank body",the header, navigation and the footer. M...

0
Q: Can I use PHP SDK and JAVASCRIPT SDK at the same time?

Jben KayeI have a php program/app which asks for input, generate an image and post th image link to user's timeline (processor.php). I used PHP SDK in posting to timeline since I am more familiar with PHP. Now, in my gallery.php, i want to show like buttons for each generated image. I am aware that i have...

0
Q: GeoRedirection script not working properly

Learner Always I am developing a country specific website, for which I thought to have a geo redirection installed at my php server. The basic approach is to record the incoming IP address in $_SERVER['REMOTE_ADDR'] and then use a geolocation database to convert that into country information. I did go with Max...

0
Q: PHP - Not redirecting on successfull login

user2955598This is a strange problem When I go onto login.php and enter my login details on my testing server I get redirected to admin.php page as I should, However when I uploaded my files to my hosting server and I go to login.php and enter my login details NOTHING happens, I mean nothing the page just ...

0
Q: Step by step third party Google API Integration

user2955564I just want to know if anyone of you ever experience using google api login authentication in Symfony2? Right now I have downloaded the google client api but I really have no idea on how to integrate it in symfony2. I have been looking for a solution on the net and all the solution suggested of u...

0
Q: Dynamic images + geolocation (google maps API?)

IE-haterI'm thinking about a possiblity for showing a users geolocation in an email. Would it be possible to generate a dynamic image with PHP which tracks the users geolocation and gives back an image. Generating a dynamic image is no problem. But before I put too much effort in it, I try to find out i...

-2
Q: Unable to run query

user2955619when i run my php page this error show: Unable to run query:Unknown column 'NUM_OPTIONAL_COLLEGE_COURSE' in 'field list' $sql ="INSERT INTO MAJOR (`COL_NO`, `DEPT_NO`, `YEAR`, `NUM_OPTIONAL_UNI_COURSE`, `NUM_MANDATORY_UNI_COURSE`, `NUM_OPTIONAL_COLLEGE_COURSE`, `NUM_MANDATORY_COLL...

0
Q: Form filled BY a table

user2955526I'm new to PHP and MSQL and trying to build my first application. In this case i need a drop down form which is filled by a table. (MSQL = PHP MYADMIN) ______________ Input table: Table_Product ID, PRODUCTNAME. (There are more columns, but don't need them.) ______________ This table is used ...

0
Q: Removing a Cron

Emincan DemirkayaI've got a problem with a cron. This is the line: 09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete When this line works i'm taking a mail from my server: PHP Warning: Module...

0
Q: Displaying the value (link) selected in a modal window with the index value

user2723949   Hi ,, I have a page with some values in a table which are read from a .csv file and displayed. The values changes with time ( dynamic ) , So I am using for loop in PHP with the size of the file as limit of loop and displaying the values and each values are links that displays a modal window ...

0
Q: You have an error in your MySQL Syntax - in a simple Query

user2802113So I am trying to replicate a simple blogging system I made a month back, But the query no longer works on my new site Here is the code <?php function BlogPosts() { $sql = 'SELECT * FROM "blog-posts" WHERE BlogDeleted = 0'; $value = mysql_query($sql); if(!$value){ die("<h1>QUERY ERROR IN B...

0
Q: Java Applet's URLConnection sent to PHP does nothing

starmandeluxeI've studied up on the Oracle documentation and examples and still can't get this to work. I have a Java Applet that is simply trying to send a text field to a PHP script via POST, using URLConnection and OutputStreamWriter. The Java side seems to work fine, no exceptions are thrown, but PHP is ...

0
Q: File upload issue in Yii/PHP

arun_phpI have a situation here, while uploading larger files(greater than 10mb) nothing happens, no file is uploading, no db entry, no error messages etc., I'am using Yii.. phpinfo says upload_max_filesize and post_max_size are 1G and max_execution_time is 3600 .After submitting the form, the page loads...

0
Q: php Find matching word from a string with array

user2568578i need to find 1 word from a string, like: $row['keyword'] = "hello my name is jon"; If the word "text" matches to one word from $row['keyword'] so do something.. i try this, but i think there is a better way: foreach($rows as $row) { if (strpos($row['keyword'],t...

0
Q: incrementing time value by 15 minutes

ashwinbhyI have value 10:00:00 in my mor_start which is of type time in mysql database i want it to increment by 15 minutes. $tim=$values['mor_start']; $date = date('H:i:s', strtotime($tim)); echo $date; the above code displays 10:00:00 but when i try to increment the time by the following code i get ...

0
Q: Getting error after deleting data

Mohamad Noor Qusyairi Manlanwell,this is my error, the data successfully deleted, but the error come out.. here is my search.php coding. The error at the line 30 <? mysql_connect("localhost","root",""); mysql_select_db("kuih2") or die("database could not connect "); ?> html code for search.php <html> <head> <met...

0
Q: TCPDF strange output

beingalexUsing TCPDF I am generating PDFs. The PDF's are one page with two PNG images inserted. This is all working fine on my local Ubuntu server but on a remote server the output is strange, see attachment. No errors are generated from TCPDF. Has anybody got any tips as to why this may be happening? ...

0
Q: Joomla parameter for template modul

PiTheNumberI have a template "ja_purity_ii_something" could be from joomlart.com. Anyway, this template contains modules like /html/mod_latestnews/default.php. In this file a parameter $list magically turns up. How can I change this parameter? Some code from default.php: <?php if (count($list)) : ?> <di...

0
Q: PHP display key => value array in order

AhmadhcI want to fill an html table from an array organized as Key => value, i use zend Framework, and my problem here that Php didn't respect the order of the value in the array when i have to print them in an html code and this is my controller: <?php class Dashboard_LogsController extends Dashboar...

0
Q: new user registration page writes to user info to .txt, sign in verifies user exists in .txt file to allow user to log in

wish i was good at phpI am new to php and trying to learn it. I am practicing by doing a php code to so that when a user is at the login screen and they sign in with a username and password, when they click the sign in button, the page will check the .txt file to see if the username and password exists on the .txt fi...

0
Q: How to trigger a PHP script after payment?

techLet's say person A has paid an virtual item that I am selling in a store. (Person A has paid using Paypal) Immediately after paying, how do I update my database to give person A the virtual item? I use PHP and MySQL. I am thinking of using a PHP to update MySQL database.

0
Q: Output specific location on IP

Michel VertongenI'm searching for a php script or javascript that outputs the correct city location based on the IP ADDRESS, something that does this. $IP_city = $_SERVER['REMOTE_ADDR']; $city = ''; if ($IP_city) { // Search to the $city of IP; echo 'Your current location =' $city; }

0
Q: Why is mysqli_query() sending empty strings to my database?

infectionslaughI'm making a register form in html and I can't make it save the data to the database, everything I send is an empty string! I don't know what's so bad with the code, I don't think the syntax is wrong, hope someone here can help me to see here I have gone wrong: <?php $con = mysqli_connect("loca...

0
Q: Merge two tables to a new table using php and mysql

user2955523Hello this is my first time i post but hopefully i won't mess up to much. Basically i'm trying to to copy two tables into a new table, the data in table 2 and 3 are temp data that i update with two csv files. It's just basic data that share the same ID so thats the Primary Key and i want these t...

0
Q: PHP/MYSQL Javascript - Insert row value pulled from database into textfield with a button

SiZaIm pulling out table information from a mysql db: I need the buttons to select the information shown into a textfield, the below code works perfectly for the mobile_number but does not work for serial_number. both field types are varchars. php to pull out info and html button <?php while ($row...

0
Q: PHP : how to insert data variable into table using postgreSQL

Beebrabiei get value from request variable this code $fname = $_REQUEST["first"]; $lname = $_REQUEST["last"]; require_once("Connection.php"); $sql = "INSERT INTO test(fname, lname)VALUES('".$fname."','".$lname."')"; if($sql) echo "Save Sucessfully"; else echo "FFFFUUUUUU"; pg_close($connect); ...

0
Q: Access config global in Zend Framework 2

Aurélien MaigretI would like to access to my global configs (config/{,*.}{global,local}.php) located in my personal libraries (in the vendor directory). But despite my search in the web, I did not succeed to achieve this. I know how to access the config file of a module : \MyModule\Module::getConfig() I know...

0
Q: Symfony2 upload file without form

Thibault MartinezUsing symfony2, I would like to upload some files only from their path on my PC. I read an excel file containing some path to pictures (like /home/thibault/pictures/*.jpg) and I want to upload them on my server. So, I do not want a form. All the documentation I have read deal with upload from a...

0
Q: Validating appReceiptStoreURL Returning 21002 Status

Infinity JamesI have created a class which handles the purchases on In-App Purchases and also the validating of receipts. A while ago I used to use the transactionReceipt property on an SKPaymentTransaction, but have updated my code a fair amount and now use appStoreReceiptURL on the [NSBundle mainBundle]. Ba...

0
Q: php query Select 10 players and 3 reserves for each one

custombrandstable players player1 player2 player3 player4 player5 ... player100 etc I need to select 10 unique random teams with 4 players as: 1 base and 3 pivots Currently trying to use: require_once "connect_to_mysql.php"; $sqlCommand = "SELECT id FROM players ORDER BY RAND() LIMIT 10";...

0
Q: mssql_query returns resourse, but mssql_num and mssql_fetch_row gives an error

LeneronI have a strange issue - I am calling a stored procedure with mssql_query, and it returns me "Resource ud #4". But when I try to work with mssql_fetch_row() it gives me an error; $res = mssql_query("query"); If ($row = mssql_fetch_row($res)){Die('ok');}else{die('bad');} //trying to fibd the mist...

0
Q: Adding images to groups in facebook graph api not working

user2955662I am having trouble getting the graph API to post images into a group. I have no trouble posting into a group feed, but as soon as I try and upload an image into the group I get the following not so helpful error message: An unknown error has occurred. I am using the php facebook toolkit. ...

0
Q: Load Data from db via javascript and php array

Levent KayaI want to get my data from mysql db with php and assign them to my javascript array. I have 200 records in my db and i will get 10 records randomly. $myQuery = mysql_query("select * from tblx where xyz=1 order by rand() limit 10"); What i want to do is take these records to assign them in to a...

0
Q: How to pass a function return value to php socket program in another page

Rincy RaphaelI wrote a client server socket program in php. Now i want pass function return value of page SearchURL.php to the Client.php SearchURL.php '; return $s; fclose($fp); } ?> the Client.php how can pass the $s value to the client.php? can i possible to run in ...

0
Q: SubQueries in yii

Naga shayanAm trying to code for a subquery select * from mob_reg where name in (select name from auth where parent ="naga"); I followed all these answer's [Sub-queries ActiveRecord Yii [How to set multiple condition on criteria for CActiveDataProvider? But am getting invalid arguments for foreach()....

0
Q: Listing a row in html table based on a condition

Harun ThuoI'm trying to list a record from the database based on its id..i have one script that lists all records from the database and displays the records in an html table.in the table, there's one row 'Campaigns' that is a link which when clicked displays only the record of one row..the idea is to list ...

0
Q: CSS effect inside PHP code

Programming_crazyI have written some HTML code inside PHP with echo as below: echo '<a class = "fragment" href = "'.$row['url'].'" target = "_blank" >'; echo '<div>'; echo "Title: $title"; echo '<br/>'; echo "URL:"; echo '<h4>' .$url. '</h4>'; echo "Pre...

0
Q: Double click an element using Selenium Webdriver - Facebook PHP library

Marcel ColombI need to double click an dom element using Selenium Webdriver - Facebook PHP library. There's no direct way to perform a double click on the element, but there's a way over WebDriverMouse this is how far I've got. $myElement = $myWebDriver->findElement(WebDriverBy::id('myElement')); $myWebDr...

0
Q: Distance between 2 gps points

joan16vI am using this function, but I need more accuracy. Any ideas? function distance($lat1, $lng1, $lat2, $lng2, $miles = true) { $pi80 = M_PI / 180; $lat1 *= $pi80; $lng1 *= $pi80; $lat2 *= $pi80; $lng2 *= $pi80; $r = 6372.797; // mean radius of Earth in km $dlat = $lat2...

0
Q: Grab days left in month past a date as array - PHP

Joey CadleHow would I grab the days of the month past a given date as an array. For instance: get_days_left('2013-11-20'); ... would return: array('2013-11-21', '2013-11-22', ...);

0
Q: Filter an array within a range when keys are timestamps

J CrowI have an array with the keys as timestamps - the actual keys are unix time, I have just formatted it here for simplicity. How can I filter this array so that it unsets all values and only keep the array between 2013-08-02 00:00:00 and 2013-08-02 00:02:00 ? 2013-08-01 23:58:30 ---->> 322 active ...

0
Q: Magento - SOAP API, Mass Update Product Visibility

Steve ChurchI want to refrain from using the import export, we have a LARGE amount of products (5,000) Basically, I have done some heavy configuration the the templates to display the catalogue in a very wholesale way for our client, if you want to look it is here (www.musclefinessewholesale.com) however, y...

0
Q: How to do ajax form post while page load after submit a form in symfony2

Mohan RajI have to retain drop down value and also some specific data according to the drop down selection. Normally its working fine for me but i need same thing after submit a form (save the data), after save i need to retain the same. Please advice about this or any other solution already having?

0
Q: Flex: How to pass parameters with prefix to my PHP HTTPService?

user2419604I have a PHP script to get data from a server. However I am having difficulty transposing the call function that has a prefix 'req= from a HTTPService in Flex. Here PHP example script that works to call the data from server: <? function sendPost($param){ $ch = curl_init(); $url='...

0
Q: force to download remote image immediately without HTML5

IgorChI trying to force to download a remote image, I failed to attempts do it on client (cannot use HTML5, thanks to IE8), so I'm trying to use server side (php). The only way how to do it I found thanks following answer, is using curl. Other way like readfile($file_url), always return an empty file....

0
Q: Youtube link string replace with get method

MezelderzTrying not to go to youtube for every video I find on some other site, and that is from youtube. If I right click and copy video URL, url will have this feature stuff inside the link, I am trying to get rid of that with str_replace. Link http://www.youtube.com/watch?feature=player_embedded&v=wq7...

0
Q: How can I find out the name of a variable inside a function?

rubo77I have a function function my_dump($a,$name){ echo '<pre>'.$name.":\n"; var_export($a); echo '</pre>'; } How can I achieve this with only one argument so the function recognizes the name of the called variable itself? for example: my_dump($cool_variable_name); will output: ...

0
Q: i am trying to get data from php and wamp server to my android.but it shows the error json parser- end of input at character 0

user2825588this is my json parser code. package com.example.sampletest; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.Lis...

0
Q: hide gridlines on a .doc generated by php

rispoli michelI'm generating .doc with php using this code below. <?php session_start(); header("Cache-Control: ");// leave blank to avoid IE errors header("Pragma: ");// leave blank to avoid IE errors header("Content-type: application/octet-stream"); header("content-disposition: attachmen...

0
Q: Cannot see wordpress widget without log in

user2834491My wordpress widget on single page isn't display to visitor ( no code on view source) <div class="secondaryColumn"></div>` ` It display normally on homepage. and when I log in I can see it on single page too. May you help me with it?

-1
Q: How to parse JSON string into Android as an Array?

mobilGelistiriciA very simple question, a lot of examples out there, but none of them worked for me. I need to parse the simplest form of a json string : {"id" : "5" , "name" : "John"} How do I turn this into an array, list, map whatever, so that I can get something like this ? myArray["id"] = 5

0
Q: store IPv6 to database after being converted to binary

wervaI have an ip table with varbinary fields: ip_start and ip_end Now I have a problem, $ip=('2001:255:ffff:ffff:ffff:ffff:ffff:ffff'); $binary=unpack("A16",inet_pton($ip)); var_dump($binary); Now, how to store $binary_start and $binary_end to ip table? Do I need any wrapping of data(such as bin2h...

-1
Q: Object not found! redirect link codeigniter

gabrielwhy i get the error : my code : <li><a href="<?php echo base_url(); ?>welcome/logout">Log Out</a></li> error : Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error...

0
Q: How to to create groups of php arrays encoded as json and return each group by name

user2944805is this possible? i want to return name and type of a car, in one json element. The normal way is this, { $return = array ('label' => $row['name'], 'Type' => $row['Type'], ); } echo json_encode($return); But i want something like this so i can just call "NameType", $return = ar...

0
Q: Error when logging in using CakePHP's Auth component

harrygI've integrated Cake's Auth component into my app. It mostly seems to work ok but I quite often get an error when logging in looking something like this: Error: Call to undefined method Security::getDataSource() File: C:\xampp\htdocs\ips-mvc\lib\Cake\Model\Datasource\DboSource.php Line: 1...

-1
Q: How to access array in outside while loop in fgetcsv

snehali want to fetch all csv file contain into array so i used fgetcsv function.it is working correct. but when i want to return my array it is empty. problem is outside the while loop. here is my code: <?php $filepath='Data\'; $csvfile=array(); /* here i did declaration */ $csvfile=csvcontain($...

0
Q: How to install pthread on php 5.4 on an x64 windows architecture?

Hugo StartThe dll founded here : http://windows.php.net/downloads/pecl/releases/pthreads/ contain a x64 version only for php 5.5.

-6
Q: Telnet via PHP code

almoujtahedHi I want to make simple telnet via php script only to check weather the connected server if running or down Thanks

0
Q: How to run PHP's OCI8 extension on Mac OS X Mavericks?

user2955794I am trying to install OCI8 on default PHP that came with OS X Mavericks (PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38)). I have installed Oracle Instant Client (Version 11.2.0.3.0 (64-bit)) and I am able to run sqlplus and connect to oracle server. I have installed oci8 using pecl: pecl insta...

-1
Q: php pagination, wont echo pagination buttons

Casperso i have made this pagination following a tutorial on the internet and the pagination itself works fine if i change the url to be correct but for some reason it wont echo the button "1,2,3,4" etc $cykel_pr_page = 1; $current_page = 1; if (isset($_GET['pagenr']) && is_int($_...

-2
Q: Login script php mysql

RobinThis is my login script. And as you might have figured it is not working. the $check is always empty. And i cant seem to find the reason for it the query is good. And i have a valid database connection. session_start(); if(isset($_POST['username']) AND isset($_POST['password'])){ $username ...

0
Q: How to remove controller name from the URL in codeigniter?

Imran AhmedI have controller named “profile” and the URL for user profile is www.example.com/profile/user I am already using the rerouting of codeigniter in the routes file $route['profile/(:any)'] = "profile/index"; what I am looking is to remove the profile controller name from the URL so it will be ...

0
Q: PHP session is getting lost completely when embedded using iframe on safari web browser

user2955865I have a php application completely depend on sessions to carry data from one page to another. Users can embed it using iframe. My sessions are getting lost completely when user access it from safari web browser. This is only happening when my php application is embedded using iframe. Working fin...

0
Q: preg match if found exclude that string php

user930026I am stuck in a very simple PHP problem. I am having a string as $a = "123 text"; or it can also be $a="lorem ipsum 1234 dummy text"; I want that the output shall be $a="text"; or $a="lorem ipsum dummy text"; In short I want to exclude the number that can either be 123 or 12345 or anything els...

0
Q: Passing PHP variables to Livecode

kexxcreamProblem: I have a number of variables stored in $_SESSION in PHP and I am wondering if it is possible at all to transfer these to Livecode scripts (.lc)? Current solution: I use $_GET to move information but I would like to know a way where you can connect PHP with Livecode and transfer inform...

0
Q: set autoincremental serial number in php

user2942100I am working on PHP using Kohana 3.2.I am displaying large number of data from database.I want to set the serial no from 1,2 upto the n-numbers depend on the number of data i am showing.I want to show the data in sequence.How to handle it through program.I can echo the total number of data(count)...

0
Q: 1. Use table data to 2. a HTML form

user2955526I have an table with data (grootformaat): ID, PRODUCTNAAM, etc. I need to have the PRODUCTNAAM to show up in a html drop down form. <?PHP $con = mysql_connect("localhost","***","***"); $db = mysql_select_db("grootformaat",$con); $get=mysql_query("SELECT PRODUCTNAAM FROM rauw2 ORDER...

0
Q: how to block a specific link on the site for a specific ip range using htacces

Dam Forumsthere is a link for a video on my php page in our server.when particular user comes from a specific region.Assume Latin America. when user comes from Latin America and video link will be displayed. but once user clicks on the link, i have to redirect user to a forbidden page. can i do this using...

0
Q: How to Pass Array from Zend Dom Query Results to table

user2955921I am querying a URL for columns YEAR, RATING and I want to insert those two into a database. E.g. YEAR RATING 1992 9.2 2000 9 1999 8 . . . . . . . . So, I am writing script like: $url = 'BLA BLA '; $data = file_get_contents($url); $dom = new Zend_Dom_Query($data); $year = $dom->query('.secondar...

0
Q: Google Safe Browsing API - Download the data from the database

MusterknabeI want to use the Google Safe Browsing API to check certain websites if they got phishing/malware on them. The problem I encountered is, that I also check the backlinks on that site and I'm following the links on the sites. Which means, I need more than 10,000 requests a day. So it would be optim...

0
Q: Array with StdClass in it

Joran Den HoutingWhen I do a var_dump on $raw, I'm getting this: array(8) { ["products"]=> array(1) { [90303]=> array(1) { ["amount"]=> int(4) } } ["totalprice"]=> float(15.96) ["totalamount"]=> int(4) ["currency"]=> string(3) "EUR" ["totalprice_format"]=> string(5) ...

0
Q: Efficient way to fetch_array from n column

HakimSay I have a table as follow: +---------+------+------+---+-----+---+ | term | 1 | 2 | 3 | ... | n | +---------+------+------+---+-----+---+ | connect | 7 | 14 | 2 | ... | 8 | | finish | 1 | NULL | 9 | ... | 1 | | ... | | | | | | | net | NULL | | ...

0
Q: Need htaccess for dynmic subdomain

user2955900I want an htaccess code to redirect a folder named exactly as the subdomain. I have activated wildcard subdomain. For eg:- I want to redirect subdomain.example.com to subdomain.example.com/subdomain. But url should be displayed as subdomain.example.com itself. Please help!

0
Q: how to code in PDO

user2434677Hi guys im having problem converting the code onto PDO, I am new to PDO, is there a way we can recode the below code to PDO for a better code. heres my code: <?php include 'class/init.php'; include("config.php"); $ip=$_SERVER['REMOTE_ADDR']; if($_POST['id']) { $id=$_POST['id']; $id = mysql_rea...

0
Q: Uncaught ReferenceError: How to get PHP variables in $.get() Javascript?

Taha KirmaniI am writing a program in which, when a user clicks on the button, the information from the Page adds into the Database. I have written the following code, it is successfully taking the values from PHP and place the values in Javascript variable, if i alert() them it shows me the correct data, bu...

0
Q: Upload Image as BLOB to database through current form - Codeigniter

user197474I currently have a form that inputs information to the database from a php form, I want to add a field to the database table called profileimage which is uploaded within the current form but I am having problems getting the image to upload... View (profile_content.php): $this->load->helper('for...

0
Q: OpenSSL error - handshake failure

clarkkOn about every second request I make to an API I get this error!? The backend on the API is one of my own servers which I have setup myself with self-signed SSL certs What is happening here!? It can't be the SSL certs because it works in some cases Warning: fsockopen(): SSL operation failed w...

0
Q: how to calculate values from database stored formula in PHP?

Jobaer ShumanI have an application which is calculate ratings. Rating formula is stored in database. Formula can change from admin settings. Let me show an example: This is formula which is stored in database: +-------+-----------------------+ | ID | Formula | +-------+------------------...

0
Q: don't show hidden table

PHPnoobI have a problem I am trying to fix. http://i.stack.imgur.com/k47u2.png. Bascially I have a jqery which active the hidden form when you click on the "send" button. The quanity and "colour" and "size"(sorry miss this in the digram) as a both server and client side validation. My problem is that if...

0
Q: wp_schedule_event not firing

user1548981I'm trying to schedule an event inside a theme's functions.php but i cannot get it to "fire". I'm using the Cron View plugin and it shows the event scheduled correctly but nothing happend when is time to execute This is my code if ( ! wp_next_scheduled( 'prefix_hourly_event' ) ) { ...

0
Q: Use of single module multiple times

Ashwini AgarwalI have created Auth and Acl modules using zend-framework2, And these two are working good. Now I want to use these modules multiple times with different configuration. Basically, I have two sections in my project - User Section Admin Section And both have different session variables and d...

-2
Q: PHP unique url per account

CP2000i am making a subscription service using PHP where i would like every user to have their own URL and or subdomain on my server . For example if the domain name is stackoverflow.com i would like each user to have john.stackoverflow.com and/or stackoverflow.com/john Currently i have "loader" p...

0
Q: How to combine these two codes

TharinduluckyOK, here's the big deal, I've been trying to build my first WordPress theme. Which has a Tabbed settings page created by me. Actually, it's created according to this article. http://wp.smashingmagazine.com/2011/10/20/create-tabs-wordpress-settings-pages/ And I wanted to add images. So, I need...

0
Q: Displaying random product in a related product table of 5

user2946964I am creating a row of "product related table of x5" and using MYSQLcode RAND to generate RANDOM products and a exception clause using id!='$id' - where id is existing product that is being viewed currently. However the problem is that all the product images generated were all of the same simil...

0
Q: PHP $_POST array is empty for no apparent reason (XAMPP?)

user1794121I have a problem, my form opens another PHP script with post method, but it doesn't pass on any values. I tried fixes such as setting in php.ini: post_max_size = 8M variables_order = "EGPCS" and Didn't work. Here's the form code: <form enctype="text/plain" action="zalogujCheck.php" name="com...

0
Q: XAMPP 1.8.2-2 Apache Web Server won't start, always stops immediately

OnovarI'm running XAMPP 1.8.2-2 on my mac (OS X 10.9) and the Apache Web server won't start. It always get the status starting up.. or stopped. (never a green light.) I already tried to change the port to 8080 or 8888 but it still won't run. Can someone please help me? I show some images below to give...

0
Q: Throwing 404 response when should be throwing 403

Manolo SalsasI have the next rule: RewriteCond %{HTTP_REFERER} ^$ [OR] RewriteCond %{HTTP_REFERER} !^https?://itransformer.*$ [NC] RewriteRule \.(gif|jpe?g|png|wbmp)$ - [R=403,L] in the main .htaccess file. When anyone try to hotlink an image, he will get a 403 response. However, he's getting a 404 respons...

0
Q: Reverse a number inside a string in PHP

Itay GalI have a UTF8 string that contains letters and digits. For example: "Hello World 37. What? 24 last 6650" and I want to reverse only the digits but keep the numbers in the same place. The output should be: "Hello World 73. What? 42 last 0566"

0
Q: Programming Paradigms: Strongly Typed parameter with Inheritance

LarsWarning: might cause TL:DR I am working with PHP 5.3.10 and have the following problem. I do have an abstract class DataMapper, which is extended for the specific DataModel I want to persist. The following code does this trick: abstract class DataMapper { public abstract function findById($...

0
Q: Building a Twitter Composer Modal with URL Rewriting

iagdotmeI've built my own Twitter app in PHP with the front end using Twitter Bootstrap as the framework. I want to build a composer window to that my app can post a tweet (or a reply). Rather than reinvent the wheel, is there something I can use that preferably uses jQuery? Ideally it would... Have...

0
Q: PHP OOP with mySQLi fetch

user1949366I am relatively new to PHP OOP and i know that there are numerous questions here on SO, but none of them seam to be pointing me in the right direction. I have created the class user, and I am calling this in another file. I am trying to get the method 'reset' to call up 'connect', connect to th...

0
Q: Different location directives in ngnix

Oscar OteroI am new in ngnix and I don't understand very well the location directive. I have a website with the folloging configuration: location / { rewrite ^(.*)$ /index.php last; } #assets location /web/assets/ { rewrite ^(/web/assets/.*)$ $1 break; } location /web/assets/cache/ { if (!-f...

0
Q: Up vote and down vote in Laravel eloquent

Sagiruddin MondalI want to create an up vote and down vote system for my website. where uniqe user can give vote up/down for one post and next time he only allow to oposite to get off from database and after that he again can up or down vote. in this case i am having users table : id name debates table : ...

0
Q: Email Validation and Deletion from text file - PHP

Andrew Glassim trying to do an email validation. i've got an input text field which i write to a file when the user enters data into the input field. i would like to have a simple code which would check if the email is valid, and if the email isnt valid go back to the orignal page and dont add it to the .t...

0
Q: Remove specific entry from database with PHP by via id

CataneoI am trying to make a button for a manager to remove an employee from the list. I know I'm doing something wrong because it automatically removed all that manager's underlings. I actually want the remove button to only remove them when pressed. Here is my function: public function view_team($us...

0
Q: how to update a qunatity if itemname is same in mysql using php

user2938105when i got a item from company then i enter a all item detail in my PHP form and its save in MySQL and there are two table in MySQL one is receive and 2nd is stock so when i got a item its save in two table receive and stock but some time stock (table) item is same so i want to update if item ...

0
Q: How to define a static variable with runtime generated name

sunlight76in a php webapp I would like to some parameters from sql. App is growing so parameters could be added. At user login I would like load parameters to static variables to be used during the session. Actually I load them at every page change, but I'd like to improve performances. Actually i read a...

0
Q: Zend Framework 2: Database connection in view helper

StonerI found a few other posts relevant to this issue, however i wasn't able to achieve what i wanted so i decided to delete everything and start over with some help... This is my work so far, which does the job but the data are provided hard coded in an array and i need to create a database connecti...

0
Q: SELECT DISTINCT for email but also get another column

user2956072Trying to get only unique emails but also show the shipping name. $sql=mysql_query("SELECT DISTINCT(email) As email FROM tbl_order"); while($row = mysql_fetch_array($sql)) { echo " ".$row['shipping_name'].",".$row['email']." <br />"; } But it does not show the shipping name, any help would be ...

0
Q: How to combine PHP's DOMDocument with a JavaScript template

James LongI've got a bit of a strange question here, but it's stumped me completely. As much as anything, this is because I can't think of the correct terms to search for, so this question may well be answered on StackOverflow somewhere but I can't find it. We have a proofing system that allows us to take...

-7
Q: how to start with website development as a beginner?

Shakti saxenaI am new to website development. Can someone tell or guide me on how to start with basic website development. which technolgies should I use and all the basic information? Thank you.

0
Q: Converting from DOMNodeList to string in PHP extra characters

Colm MulhallI have converted results from a web scrape from DOMNodeLists to strings: $node = $the_sentence->item(0); $the_sentence = "{$node->nodeName} - {$node->nodeValue}"; However now when I print out the result it includes whatever tag the text had in the page as well as the &nbsp character: Before: ...

0
Q: How to select a relationship to be a correct Boolean JSON value?

CL SoThere are three tables hotel hotel_room_type room_type hotel and room_type is many-to-many Now I just search hotel_room_type and room_type by hotel ID, to find out the room type in that hotel, and I also want to select the room type not in the hotel. The expected result should be something ...

-2
Q: Bio metric finger print extraction

sMilbzFor my final project at university I want to store fingerprints in a database using a bio metric USB finger print scanner. There is not a lot of information out there about it so I am looking to the world of SO. So once I have purchased the hardware and use it to scan my finger, what format is i...

0
Q: spl_autoload_register searching in wrong directory/file

NathanI have placed the following code in my functions file (MyFunctions.php): spl_autoload_register ( function( $Class ) { $Class = str_replace ( "..", "", $Class ); include $_SERVER['DOCUMENT_ROOT'] . '/phpsb/class library/' . $Class . '.php'; ...

0
Q: Are constants as evil as global variables and singletons?

Your Common SenseI've heard many times on this forum that using global variable is a dead sin and implementing singleton is a crime. It just came to my mind that old good constants bear all the features of these dishonored practices: they are globally accessed and no doubt they introduce globallest state ever. ...

-1
Q: can't close a current window and open new window

RedSunProblem in closing a window. i am using 4 files. link.html userdetails.php ultrapro.php final.php upto ultrapro.php its working fine like opening and closing but ultrapro.php file is not closing and not opening final.html file In userdetails.php file Working $query = array( 'username' =>

0
Q: var_export() and static class properties

TiMESPLiNTERI played around with var_export() and I'm wondering why static class properties not getting exported by var_export(). class TestStatic { public static $FOO_BAR = 'foobar'; } $testStatic = new TestStatic(); var_export($testStatic); Results in TestStatic::__set_state(array( )) Is there ...

0
Q: Regex - Remove single whitespace

hgerdinI´ve got a string that looks like this: "T E S T R E N T A L A K T I E B O L A G" And I want it to look like this: "TEST RENTAL AKTIEBOLAG" But I can´t seem to find the right regex expression for my problem. I would like to remove one single whitespace between each character. Kind Regard...

0
Q: Issues accessing returned JSON in Javascript

AlcapwnI am trying to send a JQuery AJAX post to a PHP page, and return a variable back to the Javascript. Javascript var username = $("#regFormUsername").val(); $.post("ajax/registrationcheck.php",{username:username},function(result){ console.log(data); //I have also tried console.log(data.te...

0
Q: How to store and fetch a fingerprint to a database

sMilbzFor my final project at university I want to store fingerprints in a database using a bio metric USB finger print scanner. There is not a lot of information out there on how to do this using JavaScript and PHP so I am looking to the world of SO. Can someone help to get me started?

 
11:56 AM
0
Q: Is it possible to get country details from serialized data without unserialize?

Sanchuabacies AbaIs it possible to get country details from serialized content without unserialize ? a:11:{s:8:"newsFrom";s:0:"";s:7:"country";s:2:"IN";s:15:"state";s:0:"";s:16:"region";s:0:"";s:6:"awards";s:0:"";s:7:"website";s:0:"";s:8:"facebook";s:0:"";s:7:"twitter";s:0:"";s:8:"linkedin";s:0:"";s:10:"googlepl...

0
Q: PHP/MYSQL JavaScript - Insert values of multiple dynamic rows into textfields

SiZaAs you can see in the JsFiddle, I have a table (it's a static example, but in reality it's dynamic) and it pulls out rows of data from a table. I want to be able to create one button which will inserts all of the values of the mobile number and the serial number into textfields. so if there are ...

-1
Q: Create a PHP Poll with just one vote per IP

MerlinI have an Ajax Poll for my website users, but in our case a user can vote an unlimited number of times after he refreshes the page, and the results are being recorded. I would like to let users vote just one time from their IP and after they have voted, at page refresh just to show them the resu...

-1
Q: Php calling javascript function

Marcelo AymoneI can do that? Im trying to call a javascript function after conditional php "if" <script type="text\javascript"> functioncall = (function(id){ alert(id); }); </script> <?php if(isset($_get['id']){ echo "<script>functioncall({$_get['id']});</script>"; } ?>

0
Q: Windowsphone to PHP communication through Webclient

Frank ProvostI want to upload an Image i selected with the PhotoChooserTask. The Selection itself works fine and i can open the Image. I also already decoded it to Base64 (Works). Since I can't find any working example on how to work with httpwebrequest on windowsphone I tried it the following way. pri...

0
Q: PHP for loop not getting all posted values

charlieI have a HTML Form where i can add rows dynamically, every time a row is added the number in my input field goes up each time each row there are 4 input fields and each one has the number on the end of the name on my submit page i have this PHP for loop: for($x=1;$x<=$_POST["number"];$x++) { ...

0
Q: PHP/SQL date sorting outputs nothing

KojakIt seems I'm having problem sorting my output as date. The column is date_added, but it does not seem to work very good. Here is my queries and loop, but the script doesnt seem to output anything at all! $select_votes = mysql_query("select * from images count(*) as TotalOccu...

0
Q: How to create pagination when using data from xml file

chirag NandwaniI am creating a search result page using json/XML over a link. I successfully fetch the data using for each but as there is a loop i can not able to set a pagination. There is no database from which i can get data and use pagination. Thanks in advance for help

-4
Q: How can I read user input using php alone

puchuHow can I read user input using php alone. I'm using form tags for handling user inputs.How can I do the same with Php alone.

0
Q: Yii application and Mibew chat to be compatible with each other

abramsenI use Yii framework and in the framework i use 3rd part application which is Mibew Messenger (or chat ).The both application have their own databases (the both have user table). The problem is next, 1st when i log in into my "main" application with username and password i want to be able to log ...

0
Q: Android get data from MySql table

roshanpeterI am developing an android app... where I developed a table in MySql and table has certain results for values of 1-10 and all the values are entered seperately ... in my android application when a particular value is displayed the result of that value has to be taken from the table... but it is ...

0
Q: Trying to configure ArrestDB. Something I think is wrong with my Data Source Name.

Brandon WillbanksI am trying to configure ArrestDB to create an api for my site. https://github.com/alixaxel/ArrestDB As it says in the installation I need to change the $dsn to: MySQL: $dsn = 'mysql://[user[:pass]@]host[:port]/db/; Currently I have $dsn = 'mysql://user:password@localhost/database/'; I trie...

0
Q: Sort results alphabetically in a recursive function

AnibelI was obliged to use a recursive function to fill a drop down list, however, when I tried to display results in alphabetical order using ORDER BY it didn't work! Below is my recursive function: function tree($root) { global $conn; $n=0; $result = $conn->prepare("SELECT id, name FROM perso...

0
Q: is running a repeating sql event scheduler every 1 second too taxing?

mickerI cannot find any answers to this anywhere. Is running a repeating sql event scheduler every 1 second too taxing for the server?

0
Q: php - Declare a global variable once within a class as aposed to within every function

TheApptrackerI would like to assign a global variable within a method that is within a class. Currently I have this setup and it works perfectly, but as you can see I have to declare the global in every method within the class. class myclass { public function functionOne($SqlVal){ glob...

-1
Q: php print page with header and footer in all pages depend on no of rows

Shivesh JaiswalHi i have a sql statement with php code and this query results 72 rows now i want to print this report but i want header and footer in all pages and every page limits only 25 rows. how to do this. here is my code <?php echo $header; $con=mysqli_connect("162.9.9.9","root","","lotuserp"); if (my...

0
Q: Using PDO with MySqls Like %%

jmenezesI failed with this. Despite all the answers here, I just cannot get this right. How do I bind a search term when using like in mysql with php's pdo? $searchTerm = 'kfc'; $stmt = $conn->prepare("select name from table where name like CONCAT('%',:searchTerm,'%')"); $stmt->bindParam(':searchTerm', ...

0
Q: Is it possible to combine two Mongodb queries ? #php

SreenathActually I have to date ranges, one is actual date range and the other is comparison date range. For each date range I'm executing two different queries. I selected aggregation method. Code I wrote for each date range is .. $resultsetpre = $db_1->command(array( 'aggregate' => 'ACCOUNT_PERF...

-1
Q: You have an error in your SQL syntax - Update SQL

user2536680I have the following code mysql_query("UPDATE `stocks` (`price`, `open`, `high`, `low`, `chng`, `time`, `percent`)VALUES('$pricez', '$openz', '$highz', '$lowz', '$changez', '$times', '$percentz' ) WHERE `symbol`=$symbolname"); And, it keeps throwing the following error: You have an error in ...

0
Q: application/msword insead of application/vnd.ms-excel

piernikBoth functions (mime_content_type and finfo_file) returns wrong mime type (application/msword) of my xls file. Question is why? This tool http://mime.ritey.com/ returns proper mime type - application/vnd.ms-excel I use script for attachement management for webmail and it has to be very universa...

0
Q: filtering the data based on different Ids using php and ajax

user2956205Hi Friends I am Generating report based on different ID's.please give me the suggestion to write function using php.how to use the ajax responce for this. please some examples for this using ajax and php. for example redbus.in filtering.I want to use same functionlay for my report.please pleas...

3
Q: How do I get the last used variable in PHP?

rubo77in bash there is something like $_ which is a temporary variable that stores the last argument of previous command is there such a thing in PHP or how can I access the last used variable in the script? this would be very handy for simple debugging functions.

0
Q: PHP CSV upload checking and skipping headers line

Sabri if ($_FILES[csv][size] > 0) { //get the csv file $file = $_FILES[csv][tmp_name]; $handle = fopen($file,"r"); //loop through the csv file and insert into database do { if ($data[0]) { mysql_query("INSERT INTO PowerFlex (customerCode, postCode,Name,...

0
Q: Display an image before each tag in Wordpress

Camilla WestinI have made custom posts with custom taxonomies. I am now trying to display an image in front of every custom tag. With the code below I can only se an image in front of the first tag. I'd like the image to show before every tag. <?php the_terms( $post->ID, 'case_tags', '<img src="theimage" />','

0
Q: Value of Array is Sting not integer

MarkPI have a multi-dimensional array which I need to pass to Google Charts. The script is called via Ajax, runs three times and then passes back the array json_Encoded. I then needed to add headers to the array so I used array_unshift(). here is the script $dataArray = array(); $i = 0; ...

-1
Q: Can I run a CRON job for an hour

Peter StuartI am creating an app that requires a CRON job to be executed every 60 seconds. My host only allows a CRON job once an hour. I was wondering if I could create a script like this: $i = 0; while(1==1){ // update database code delay(10000); // $i is incremented once a minute/10000ms $i++; } //i...

0
Q: Magento indexer.php - Duplicate entry occasional errors

Raul SanchezWe have a customer with a huge catalog (around 100k references) synchronized every night with an external ERP The synchronization process does not anything strange, just set some data for products & then save() them, using Magento methods & try/catch checks, so we can be sure the saved data is a...

0
Q: change label html from within the page

user2865808hi i'm new at programimg web pages, but i have this question, i need to change several labels in a html page an i need the change to be permament, the thing its i want to change it when the page its already loaded in the web browser, so however visit the page can change the labels. some friend ga...

0
Q: Laravel 4 - Dinesh/Barcode - QRCode

SinpatogoI downloaded this package : http://registry.autopergamene.eu/package/dineshrabara-barcode and i don't understand how does it works. I would like to generate a QRCode. But there is no documents which explain us how to create a basic qrcode. Someone ever tried this package and can explain me ho...

-2
Q: Coin game in php

user2956240Basically my problem is the following, two friends are playing a game in where they put all coins on a board in three piles, they can take the coin from whichever pile they want and I need to know who has the chance of wining more. The player x will always start first.

-2
Q: How seperate one array to two array by php

NguyenI have this array: $array = array(1,2,2,11,1,3,1,4,3,1); I want to seperate it to two arrays: $arr1 = array(1,1,1,1); $arr2 = array(2,2,11,3,4,3); How can I do?

0
Q: MySql timestamp query and comparison in monthly and weekly

Christian Burgosi have a table where i enter entries for applicants. it has a column date_added where the type is timestamp and the default is current_timestamp. i want to make a weekly and monthly report but i can't decide what would be the best thing to do. i need an sql statement that return the number of ent...

0
Q: E-mail not getting sent in PHP

user2956287I have the following code in a PHP file. $to = $row['EmailID']; $subject = "XYZ"; $message = "yes!!!!"; $from = "pallav123goyal@gmail.com"; if(!mail($to,$subject,$message,"From:" . $from)) { echo "Confirmation E-mail couldn't be sent to " . $row['EmailID'] . "<br>"; } else { ...

0
Q: Parse Mongo Json object to android [Display hello world from mongo to android applcation

peterodoherty92I need to parse data from a mongodb collection to android application where i will its can be parsed by json and displayed in the android applcation. `database->collectionName; $document = $collection->findOne(); echo json_encode($document); ?>` this is the php code for my web service i conn...

-1
Q: how to update if two row is same in mysql

user2938105this code is select item name and update value and i want if item name and company name is same then update like that $result = mysql_query("UPDATE stock SET quantity=quantity - $quantity WHERE itemname='$itemname',company='$company'") but its not working it is showing this error You ...

0
Q: How to write the .htaccess file?

Billeh SarkozyAnyone to help me re write this http://halisi-kenya.com/articles.php?id=30 to http://halisi-kenya.com/articles/tile-of-the-article

0
Q: Yii Framework syntax error, unexpected end of file

KonterI know parse error and such things are programmers 101, but I cant find whats wrong with the file and the error "syntax error, unexpected end of file" Following the tutorial helps me a lot getting to know php and Yii, but maybe the error isnt in that file, maybe somewere els. Hoppyfully you can...

0
Q: Can´t set cookies | SET-cookie header correctly

idontevenI can´t set cookies with setcookie(). I thought it´s really easy to set cookies with this, but it won´t work... What I found was this: Something to add cookies in a header with "set-cookies". This should solve my problem (I guess, didn´t try by now). Set-Cookie Header With Multiple Cookies Th...

0
Q: MySQL to MySQLi Convert Samples

Nenad dvLIf someone could just show me how to replace / fix it for mysqli I'd appreciate. Here are two examples, so I can learn from them and go through to fix everything required. Sample 1: include dirname(__FILE__) . '/database.php'; mysql_select_db(databasename, mysql_connect(server, user, pass))...

0
Q: OOP PHP make separate classes or one

user2956219I'm studying OOP PHP and working on a small project but I have hard time grasping some concepts. Let's say I have a list of items, each item belongs to subcategory, and each subcategory belongs to category. So should I make separate classes for category (with methods to list all categories, add n...

0
Q: Sending a PHP response to specified webpage

ChronnieI got a tiny question about PHP responses. I tried the tutorial provided by W3C School about Ajax and PHP. Everything worked fine. But now I want to send the response to another webpage instead of the webpage that triggers the event. This is my AJAX Code: function remote_function(int) { ...

0
Q: Generate links from folder names and link to file within. PHP

user2956284I'm trying to recreate this in PHP but having some difficulty. Basically I'd like to open a blank page with a List of of all folder names within a given folder. These will be presented as links, linking to the same PHP file I made earlier. i.e. folderA folderB folderX folderY If these were th...

0
Q: Why does my PHP site alternate between two cookie values?

samejeansonI'm currently building an online shop where you have many options to configure your product before buying. All configuration data is stored in the PHP session on the server. Although we have a separate button for starting a new configuration, it turns out that when helping clients many of our emp...

1
Q: cake : how to update a specific field in HABT relation?

Moyed AnsariI have $hasAndBelongsToMany relation between projects and documents and they are linked with associative table projects_documents(id, project_id,document_id). Something likes that class Projects extends AppModel { var $name = 'Projects'; var $hasAndBelongsToMany = array( 'Documen...

0
Q: Get Meetup events data through meetup open events stream in php

Sheikh JamesI am trying to get meetup events data through meetup open event stream API. http://www.meetup.com/meetup_api/docs/stream/2/open_events/ i am using the following code for get data . // Open a stream in read-only mode if (!($stream = fopen("http://stream.meetup.com/2/open_events", 'r'))) { d...

0
Q: Uncaught SoapFault exception: [SOAP-ENV:Client] true in

Bhavin Ranai m using php soapclent, other calls are working good with this URL.here is the snap of the request to be passed. not getting what is the problem ? ( ! ) Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] true in C:\wamp\www\ginger\createEditProfile.php:8 Stack trace: #0 C:\w...

 
00:00 - 13:0013:00 - 00:00

« first day (259 days earlier)      last day (51 days later) »