« first day (295 days earlier)      last day (15 days later) » 

1:01 PM
0
Q: SyntaxError: invalid regular expression flag a

UsmanHi I am using JQuery Zoomer and in place of larg Image path i am giving this <script type="text/javascript"> jQuery(document).ready(function($){ //fire on DOM ready $('img.zoomer_panel').addpowerzoom({ defaultpower: 2, powerrange: [2,5], largeimage: "/edito...

0
Q: How to use Ajax , JQuery in yii

Rizwan Shamsher Kaim KhaniI am using Ajax and jQuery in yii. I have a view its url is like that. http://localhost/UnderstandQuran/index.php?r=Verse/topicverse&topic_id=1 Now there are some radio buttons group. When i click on it, it will be called by jquery. My View Code. <?php $i= 0; foreach($data->verse_lang as $v...

0
Q: php: variable scope, how does this file know this variable?

user2747609My PHP is not very good so this may be a dumb question. Anyway, I'm jumping in to do some work on a commercial site. A aesthetic change needs to be made. Found the file that generates the page. The first line of the php file is this: <?php if(render($content)): ?> I printed out $content to see...

1
Q: How to get the values from checkbox as an array

Mushfiqul TuhinI have few checkboxes which generates dynamically via php. I need to pass those checkbox data to another php file for process as an array. I want to pass those data via jquery/ajax. But I cant pass those data as an array. My codes are below, jquery ajax var data = { url: '<?ph...

0
Q: is my php code vulnerable to sql injections

user3091150a friend of mine told me that using this script to authenticate users is real risk to sql vulns <?php if(strlen(strstr($_SERVER['HTTP_USER_AGENT'],"-- IPB Vaidation --")) <= 0 ){ die('Login Failed!, Please try again.'); } $name = strtolower($_GET["name"]); $password = $_GET["password"]; $digit...

 
1:13 PM
0
Q: PHP, PDO Connect statement

TryingToBeZenI'm not that awesome with PDO, been learning it to update my PHP standards, I thought I had it cracked,however I keep getting an error. I have used this before and it works and there is nothing I can see that has changed. echo "before connect"; $conn = new PDO('mysql:host=host...

0
Q: Laravel 4 many to many relationship error when no records match

mr2_kasperI'm trying to build a messaging system. Where I have users and conversations with a many to many relationship. I can get the user and the conversations the user is in with: $user = User::with('conversations')->find(Auth::user()->id); Or: $user = User::with('conversations')->find(1); The pr...

0
Q: Get specific html tag

Marius DjervOkey, the table row contains this: <ul> <li> <img> </li> <li> <img> </li> </ul> And I need to only get the images out, and theres no other way to retreive these files. I know, its a stupid input. But is there a way to get only the img-tag out?

0
Q: file upload progress during upload

user1844626I'm having some problem with file upload progress. I'm using zend framework 2.2 on xampp, windows 7. Form (SignupForm) : namespace Application\Form; use Zend\Form\Form; use Zend\Form\Element; class SignupForm extends Form { public function __construct($name = null) { ...

-2
Q: Mix date in arrays

vuz3I have a couple arrays with some options, example : --------------------------------------------------- Category1 Category2 Category3 Category4 --------------------------------------------------- options1 options1 options1 options1 options2 op...

0
Q: Codeigniter url not working with subdomain

OmadeI have created an application using Codeigniter and I have hosted it on to a subdomain, I have also used an htaccess file to redirect and I put the htaccess file in the same folder as the system and application folder, but I cannot access the site, I am sure I am doing something wrong but I do no...

0
Q: Calculate time elapsed in php - spans over 24 hours

Smithey93What I am trying to do is add up hours/mins/secs that span over 24 hours, for example: 12:39:25 08:22:10 11:08:50 07:33:05 What I would like it to return is "39:43:30" rather than a date from 1970. Below is the code I'm currently using (note - its from within a class, not just a function). pr...

0
Q: Extending Laravel core logging

SynackSAI'm back with more Laravel problems as I'm having a problem understanding things. Again, I'm attempting to create a package to do my own logging. After doing some extra reading and going through the core code and trying other approaches, I've come to the conclusion that all I need to do is exten...

0
Q: HOw to add specific noumber of days to date stored in a variable

user3068213I am fetching date from database and stored it in a variable called $lastRequest[1]. Now I need to add certain number of days which are stored in variable $licChkFreq to the date stored in $lastRequest[1]. I am using this code: $nextRequest=$newExp = strtotime(date("Y-m-d", strtotime($lastRequ...

0
Q: how to pass current year as default argument in php function

Akarsh SatijaI want to pass the current Year as one of the default value of a function I AM using date("Y") for current year So it work fine when i write function in this way: function MYfUNCTION($month,$year = 2013) { } But I want to pass current year instead of 2013 but it gives me an error when i w...

0
Q: locale_get_default() function issue on localhost

BoraIm using wampserver on localhost with; PHP 5.3.13 Apache 2.2.22 Enabled php_intl.dll extension But i got following error while using locale_get_default() function Fatal error: Call to undefined function locale_get_default() in Or using Locale::getDefault() function Fatal error: Clas...

3
Q: How to create list object as public in PHP?

RockyI have tried to create public instance for list object. But I cant be able to achieve. class DimensionsValue { public $DimensionName; public function __construct() { list($Dimensiondistribution)=array(new DimensionDistribution()); } ...

0
Q: Yii: Binding parameters for SELECT in CDBCriteria

ArfeenI'm using Yii CDBCriteria to find records. I have to put a string value as a custom column in "SELECT" like this: $criteria = new CDbCriteria; $criteria->select = array('*, DATE_ADD(createdon, INTERVAL :timezonediff SECOND) createdon' ); $criteria->condition = $main_condition; $crite...

0
Q: loadHTMLFile when there is no www prefix

Oliver TsangI am using the code below to try and load in the following url : http://odds.bestbetting.com Problem is, it won't load in. I am thinking it's due to there being no www prefix, because the same code works for any other site with a www prefix Anyone got any thoughts/ideas how to get this working?...

0
Q: Best way to add custom options in Magento

user2866251I am currently trying to create my own custom type in custom options for products in Magento. My custom_type has options which are different to the standard options of other custom types, for this reason I am pretty sure I have to create a table in a database. In magento products when saved are a...

0
Q: Facebook sdk php send notification to user friends

user2802368I can send notifications to a user's friends using my facebook application log? In my application login ask permission email, user_location, user_likes, user_birthday, publish_stream I would like to send notifications with a url like: www.site.com/?code=12345 I've seen that I can send invitati...

0
Q: load funciton in PHPExcel making connection reset

nikI am using PHPExcel version 1.7.9 for reading .xlsx file. For loading I am using if(file_exists($path)) { $objPHPExcel = PHPExcel_IOFactory::load($path); ... Its running in desired manner for some file (running good for about 500KB file having 1000 rows and 103 cols) but for larger file ...

0
Q: Add Custom filter to User admin list

hinaI am displaying one custom column called company name in default user listing page. Now i want to filter that user listing page by that column name company name. How i can add my custom filter (one of meta_key) to filter default listing of user by using my column. Please find image for more clari...

0
Q: Search not working after insalling SphinxSearch

Gaston FlanchardMy sysadmin installed SphinxSearch on our wiki server. He told me that the search works in command line, but it doesn't work anymore on a web page. I'm not really clear and I don't know much about this kind of stuff, so basically, here is what this query returns : api.php?action=query&list=search&...

0
Q: PuTTY killed PHP script without explanation

Robin93KI currently have that Problem that PuTTY kills my script without permission and or any explanation. I'm starting the Scripts in the following way: bash cd 'path' php -f 'scriptname'.php Except from an final echo which tells me the result of an calculation the script made(and the time it took), ...

0
Q: Bigcommerce PUT (Inventory Level) using PHP / CURL - ERROR 415 Input content type is not valid

Matt HornerMorning All, I am trying to update a SKU's Inventory Level. I am using this URL... (with my store) https://mystore.mybigcommerce.com/api/v2/products/76/skus/3.json This works (if i go here and enter credentials I can see the GET data about this SKU. Now the information about updating invento...

0
Q: Object not found! The requested URL was not found on this server.

user3085177I am creating a database using php and viewing the tables in html. Within my coding I scripted an "add/insert" function to insert within the table with a submit button. When the submit button is selected it takes me to the error message listed above. I am not sure what I have changed, I ran th...

0
Q: Catch session creation error in PHP

rccorosI wanted to be able to catch the error in session creation in PHP. My primary target is to be able to know which causes the problem. Is it because we don't have wrtie access to the folder where the session is written or because we don't have free disk space already. So of course we will start wi...

0
Q: Using htaccess or a php file to cache only static files

crazy_PHP_MANI am looking for a way to implement cache control & expire headers to my images/css/js files. I looked for tutorials & only found ways to add cache control using file extensions. The code below is the one got from http://betterexplained.com/ <FilesMatch "\.(jpg|jpeg|png|gif)$"> Header set Cache-...

0
Q: Order by numeric value SQL query in Laravel 4

JamescooI am displaying the top rated articles of my blog : $top_articles = Post::orderBy('rating', 'DESC')->take(5)->get(); The ratings are from 0 to 5 with decimal (example : 3.8), so I'm using a SQL column type "float": Column | Type | Attributs | Default rating | float(2,1) | ...

0
Q: Why must this variable be outside of the scope of setInterval?

crmI have a working countdown timer that currently requires the page to be reloaded once the time has been reached before it will count down to the next time. I have attempted to move the code that determines how many seconds are remaining to inside the setInterval so that it doesn't require the p...

0
Q: Multiple dynamic firewalls Symfony2

JGrinonI am developing an application in Symfony to manage multiple schools. The application has multiple databases, one for each school, and multiple CAS servers. If I only manage a school, the configuration would be like this: # config.yml be_simple_sso_auth: admin_sso: protocol: ...

0
Q: php how to publish data filtered by the current_user

SamotnyPocitacWhat is the best way to make the data available to not signed in users but at the same time keep the set up of an individual user who created it. I have a site where you can create a table of data. Everything is filtered by $current_user->ID. When the user complete his table, I would like to cre...

0
Q: filter data from an array - php

Nishant GhodkeI have an array with the friends data including their name, id, gender. I want to extract the data from array which have opposite gender. For example - My gender is "Male" Returned data - [118]=> object(stdClass)#121 (3) { ["name"]=> string(9) "Rawa Su" ["gender"]=> string(4) "male" ["id"]=> s...

0
Q: How to get ship date according to shipping method selected at checkout?

ChiragHow to get Ship date at order section depending on shipping method that was selected during checkout ? Lets say Customer A selected Ground Fedex shipping method during checkout and it takes 2 days then I want dynamic date (Automatically checks sundays and holidays and generated through API) ? How...

0
Q: Allow users to add custom queries to Mustache variables

Fez VrastaI'm writing an application that will be managed by my team, it uses Mustache.php as template engine. I have a PHP file that makes an array of variables and functions that is passed to the Mustache parser to populate the template. I even provide a system to override partials of my template to ed...

0
Q: Mysqli query not working - no error message

user2991252Right now I could not figure out what is wrong when I try to query a table at my mysql-server. Did I miss something crucial? I want to get the last date in the table that is in the column after the primary key id. Norr error-message are appearing but when I echo the date no value are printed. ...

0
Q: Not getting PHPASS

Richard HarperI am try to offer the best password safety I can for my program, after some research all roads seem to end at PHPASS as my best option. I'm doing some experimental trials to understand what I'm doing. it's not going well lolAs far as I can see PHPASS adds a random salt to the password and then ha...

0
Q: PHP Multi Login Ranking

Hassan Althafso I have my site which i am coding, in my login.php, this is the source: <?php include "out_config.php"; session_start(); $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); if(!$username) { header("Lo...

0
Q: Is it possible to include external content with php? Is it SEO friendly?

dadadeyI need to include an external page into my website. How SEO friendly is this? And which will be the right code to use? I came a accross a few different codes and I'm not sure which to use...

0
Q: Content-Type: image/jpeg for OpenCart ajax template file

Dipak Kumar PustiHere is the img tag for gallery page which is purely dynamic and the image source will change repetedly, <img src="index.php?route=common/ajax/displayimage&amp;image=<?php echo urlencode($image['artwork']); ?>" /> It calls displyimage() inside ajax controller. Below is the content for ajax pag...

0
Q: magento FPDF error: Some data has already been output, can't send PDF file

user3087281i'm having the next problem: I try to see a pdf in one magento phtml this is my code: $fileName = Mage::getConfig()->getOptions()->getMediaDir()."/pdf/Gutschein-v2.pdf"; $pdf = new FPDI(); $pdf->addPage(); $pdf->setSourceFile($fileName); $tplIdx = $pdf->importPage(1); // use the imported pag...

0
Q: OOP - Connecting to database via __construct

403 ForbiddenI'm very new to OOP and am trying to learn it. So please excuse my noobness. I'm trying to connect to mysql and to test whether the connection is successful or not, I'm using if-else conditions. Surprisingly, the mysql_connect is always returning true even on passing wrong login credentials. Now...

0
Q: Bootstrap 3 - content not visible

user3050023I created a responsive wordPress theme with bootstrap 3 (header and footer) but the content isn't showing up on any pages of the website: http://www.dawaf.co.uk/creative-mapping/ I'm not sure if the problem lies within the container div. header.php <?php /** * Default Header * * @packag...

0
Q: Apache HTTP Server "The Requested Operation has failed" when Starting

John ArckaiWhen I uncomment the line below an I start the server I get the Error "The Requested Operation has Failed" but when I comment it and start the server I don't get an error. What could be the cause of this error message as it seams to be preventing the Apache Server from starting with PHP enabled. ...

-7
Q: factorial using php or javascript

user3088323Develop a function using php/javascript which will take “9999”as input and show us the value of the factorial of 9999. It has to work for any number and should display the factorial as well. For example- if it takes “8” as input, it will show “40320” as output. Remember! In this case, your func...

0
Q: contact form sending blank emails

user3018817Can anyone think of a logical reason to why a contact form which works perfectly well on my 123 reg account, will not work on my clients account? when I test it on my side, i get the email and the form contents through to my inbox perfectly but when the same codes are used on my clients account, ...

0
Q: How to user a 'greater than' PHP statement with MySQL Decimals

AdamI have a decimal(15,2) field in my MySQL database named 'price'. I would like to do something like this with PHP: <? $price = $row->price; if($price >= 75) { echo 'Free Delivery'; } ?> Do I need to turn $price into an integer before doing this? If so, what's the best way to do this?...

0
Q: POST JSON data from iOS to mssql Server

simona milcevskaCan someone please tell me what is the best way to create web service that sends JSON to MS SQL server.(php or .net POST web service?) I want to host the web service on IIS if possible.Links of tutorials will be very useful. Many Thanks.

0
Q: htmlspecialchars $_POST and empty string, PHP 5.4 and ISO-8859-1

user3091323after updating to PHP 5.4, I can't have working a script I'm using, and I found the problem being htmlspecialchars (I get empty string with € symbol and accented characters). I tried with a simple form in an html page: <form action="special.php" method="post"> field1: <input type="text"...

-2
Q: créer un champs ID annonce dans le formulaire adresse livraison Magento qui servira pour definir le mode de livraison

ANIS.Aj'ai crée un champs personalisé dans l'adresse du shipping magento j'arrive a me connecter a la base (base externe) pour verifier l'existance de cette valeur dans la base si elle existe je modifie la valeur de la variable (custom_var) ==1 pour pouvoir la passer au module owebiashipping mais mal ...

0
Q: Call an array outside Foreach

rahul251How do I access my array $page_array outside the main foreach loop. Im just unable to print my array content outside the main foreach. foreach($temp_ch_output as $ch_finaloutput) { //code if(is_array($pagetitle)) { foreach ($pagetitle as $pagetitles) { $page_array[$j]['page_view'] = $pageVi...

0
Q: Calculate route and the list of places along the route

user3091285I ask this question in general form because I don't know where to look for this kind of solution. I need the list of Cities and Villages that will be along the route from from point A (specified by lat,lon) to the point B (also specified by lat,lon). This list should be in correct order from poi...

 
2:06 PM
0
Q: alphabetical sort of tags

Andre Cheniermy input in my related MySql table, my each article (each table row) has its tags in row's related cell. my tagging format has 2 rules: seperate tags using comma and 1 space character (example: tag1, tag2) if tag has more than 1 word then seperate the words with dash symbol (-).(example: smart...

0
Q: Query fails but error message is empty?

Cobra_FastMy mysql_query($query, $sql) returns false, which according to the manual signifies an error. However, mysql_error($sql) returns "" (emptystring), which according to the manual signifies no error. Other prior queries on the same connection execute fine. My exact code is: if (!$sqlResult = mysq...

0
Q: cURL HTTP Code is 404

MusterknabeExample site: http://web.de in browser: working without any problems in cURL : gives back error 404 not found. curl options $cookie_file_path = "/adm/cookie.txt"; $header[0] = "Accept: text/html,application/xhtml+xml,application/xml,"; $header[0] .= "text/html;q=0.9,text...

0
Q: Random error on prod env that concern only logging page, (104) FastCGI

GeorgioHello and sorry for my language :) I read tons of thing about these errors: [Wed Dec 11 14:00:14 2013] [error] [client x] [host dev.wbox.fr] (104)Connection reset by peer: FastCGI: comm with server ".../web/app.php" aborted: read failed, referer: .../web/login [Wed Dec 11 14:00:14 2013] [error...

0
Q: How do I implement AJAX into CodeIgniter?

JamesI am trying to understand the process of implementing AJAX Query into my CodeIgniter application. The goal is to a have a clickable division (button) in a view. When this div is clicked the AJAX query is called and retrieves 5 movies from my DB and displays them in the view. Right now I have a ma...

0
Q: Database schema for handling multiple products with different categories having different properties?

AlastorftwI searched a bit already on StackOverflow and found a few posts concerning this topic, but somehow they didn't help on one specific thing. I know this might be a really simple and basic topic, but i don't know why i'm stucked. I need to make a database for products which all are related to a cate...

-3
Q: Remove every 3rd char in php

user3091406Trying to return the given string with every third letter removed. would this be correct? function removeThirdLetter($sentence){ $output = "" for ($i = 0;$i < strlen($sentence);$i++){ if($i % 3 == 0){ $output[] = $sentence[$i]; } } return $output; } ...

0
Q: MySQL Count Records Based On Criteria Within A Group

GebraffeI have a table containing the following data columns: ord_number check OR123 0 OR125 1 OR123 2 OR123 0 OR124 0 OR124 0 OR125 0 OR123 0 The check column indicates if we have fully supplied the order line with a value of zero or below meaning 'yes we have ...

-2
Q: Integrate bulk SMS system to website, sending more than 100 messages on one click of a button in PHP

avinashI have been suggested and answered almost every time i have questioned on stackoverflow. I hope this time also i will get some suggestions from you. I have designed a website, basically its a community website. I want to send messages to all my website registered members at a time by using simpl...

0
Q: GROUP values matching criteria to single distinct array

linuxaticoI have a table with this structure: MyObject(id, name, category_id, t1, t2, t3, t4); t1, ... tn are n foreign keys to a table MyType(id, name); Given a category_id, I want a list with all MyType's ids "used" by MyObjects with given category_id. I can do this via php dissecting the p...

0
Q: Adding/Appending Dynamic Div with Database (SQL) Select Box on Button click and inserting those values to dabase

user2672830I need to add a dynamic div with a database list box on button click and allow the user to chose the values and insert the same to database on submit button click. Please see the code <table> <tr> <td> <input type="text" name="data1" value="abc" /> </td> <td> <button type="button" onCli...

0
Q: track paypal sale using php

user2320462I have the following paypal form with a test product: <form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="paypal_form"> <h3 style="text-align:center">Test Product</h3> <p align="center"> <input type="submit" value="Click to Pay thru Paypal" /></p> <input ...

0
Q: Can I get email receiver name from linux mail server logs?

TomI had a PHP script which called mail() function with FROM set as "Name Surname" with empty email ('Name Surname <>'). So I received the email with FROM set to 'Root User '. It was altered because email was empty. Can I somehow retrieve the original 'Name Surname' from server (mail sender) logs?

0
Q: PHP self validating form Checkboxes

Vynce82I have a PHP self validating form that is validating all fields but not reporting the checkboxes to output. I can't seem to find an example to clarify. Please help! //make sure one of the services requested checkboxes are checked $require_one_of = array('walkSale','RawSale','groomSale'); //nam...

0
Q: imagecreatefromjpeg and imagejpeg, instant quality loss?

KaremSo I ended up slicing all my functions up and debug why the quality loss is happening in all pictures I am uploading. Now I have 2 lines of code, which is simple to understand and where the issue is. See the quality loss: http://gyazo.com/2ba4f42960a9b96b83f5eca4aadcf7e7 The right side is the ...

0
Q: Delete files getting names from array without knowing extension

NiceroI have an array which contains a number of file names without extensions (below, the numbers are the name of the files): [1] => 214 [2] => 12 [3] => 2763 [4] => 356 [5] => 87 I would like to delete these files from the server without knowing their extensions (which could be .jpg .JPG .GIF .jpe...

0
Q: download smiles to another function

user3089022I should have made ​​such that writes :) then there is a smile on the status of the wall on the website. This is how I want the wall content download smiley in one way or another. function smiley() { $smiles = array( 'xD' => 'devil.png', '>:)' => 'devil.png' ); foreach...

1
Q: PHP multiple-connection socket (broadcasting issue)

grimv01kWhat I'm trying to achieve is a socket server that broadcasts some data to all connected peers. This is code of server loop: while(TRUE) { $read = array(); $read[] = $socket; for($i = 0; $i < $max_clients; $i++) { if($client_sockets[$i] != NULL) { $read[$i+1] = ...

-1
Q: Designing Html5 Powered Shopping cart ??

user3081972I am developing a mobile shopping cart, I am following this tutorial, http://go.developer.ebay.com/devzone/articles/building-html5-powered-shopping-cart-ios-part-1 In this tutorial, Iam getting the products as Json into Html. For getting the product as Json iam using the following code, <?p...

0
Q: PDO throws exception with a warning

MfaspkI have successfully written my OOP class that extends PDO and everything seems to work as expected! However I am confused that if wrong db user/pass combination or name is provided, it throws Exception which is good but if "db host" is incorrect or invalid, it throws a warning with exception, why...

0
Q: Substitute for MySQL?

Rik TelnerIs there way to create database in one file? I have a PHP script, is there possible to use PHP syntax (as Apache) to read correct data from one single database file? Something like: http://www.sqlite.org/about.html But this requires more than 1 file.

0
Q: Are there any tools or techniques for php to discover all classes particular class depends on?

HongKilDongAre there any tools or techniques for php to discover all classes particular class depends on ? For example to find out which classes CActiveRecord (Yii framework) class depends on (CComponent, CDbException, CHasOneRelation and so on)

0
Q: Xamp object not found

MutekingSince I've changed my secondary drive, xamp doesn't work anymore. Everything in c:\ is the same as before. I've got my php code in htdocs folder (same as httpd.conf) but when I type in firefox http://localhost/xamp/Mywebsite/index.php it says object not found.

0
Q: Detect whether logged user visited page before as unlogged user

JoeI was wondering whether it is possible to detect that currently logged user visited the page before but not being logged in. I was thinking of IP, cookies, browser etc, but IP may be changed easily, delete cookies is a piece of cake, also you can change browser. After some searching and thinki...

0
Q: API design pattern with App in mind

LeeIf you were asked to build a site which takes bookings ie Hotel Bookings and needs to be for desktop responsive design and a mobile app would you create the backend as a complete API? The moving parts will be. Front end to take bookings App to take bookings Backend to manage bookings Partners ...

0
Q: navigation buttons go out of the div

RobinMy navigation of my website acts strange 2 buttons go out of the div and i cant fin the reason for this. the thing i want is that the 2 blue buttons are on the right of the div but if i float them they still stay out of the div. image: HTML: <div id="navigation"> <ul> ...

0
Q: How to get the facebook username in wordpress facebook all plugin?

NaveenI am using facebook all plugin for facebook login in wordpress, but it is not retrieving the username, instead of username it is appending the firstname and lastname. how can i get the exact username? $fbdata = facebookall_get_fbuserprofile_data($fbuser_info); if (!empty($fbdata['email']) A...

0
Q: cake php accessing a table

artSirI just started cakephp following there tutorials I'm able to grab the posts table in my post controller and spew it onto my index.ctp In my view for the post controller i also want to list the User name that posted the article. My post table has a user_id, so i need to match it to my user table ...

1
Q: render individual option from radio Element in Zend Forms

jetaweI have this element inside my Zend form $genderOptions = array( 'male'=>'male', 'Female'=>'Female'); $gender= new Zend_Form_Element_Radio('gender'); $gender->setDecorators(array('ViewHelper')) ->setAttrib('name', 'gender') ->setAttrib('class', 'required error pull-right') ->...

0
Q: imap_open function in PHP sometimes see blank message body

charlieI am using imap_open function in PHP to download emails and insert them into a mysql database Here is my code to get the body message: $message = quoted_printable_decode(imap_fetchbody($inbox,$email_number,1.1)); if($message == '') { $message = quoted_printable_decode(imap_fetchbody($inbox...

0
Q: PHP querying MySQL, showing "count(*)"

MaffI have inherited an old system at work, php 4.4 and MySQL that we run our helpdesk software from, I cannot upgrade anything until next year. I'm struggling with something though. I need to show the total number of calls logged between 2 and 1 hour ago. in the database, the unix timestamp for each...

0
Q: Error with this.id in Javascript

Bate WesOk, so I'm using JS and I am having issues with the following function. In my PHP file I have: <?php $file = fopen("utensils/".$cake.".txt", "r") or exit("Unable to open file!"); while(!feof($file)) { $image = fgets($file); ...

0
Q: Need to populate a database with values from 2D Array

user3091533Apologies if this question exists already. When I search for this, all I get are answers about populating an array from database values. Context: I'm parsing a CSV into a 2D Array in PHP (using an external library) and I need to move these values into a database now. The database has 1 table (...

0
Q: Call specific variable based on what another variable is set to.(PHP)

AkelI am not exactly sure how to word this in the form of a short question...the above called up many different answers that were not related, but I apologize if this has been asked before. I am trying to make a variable name itself based the value of another. I could simply create if statements f...

0
Q: When I click UserInfo button If forced close my application

NickThis is my logcat 12-11 22:42:30.949: E/AndroidRuntime(11497): FATAL EXCEPTION: main 12-11 22:42:30.949: E/AndroidRuntime(11497): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.pmss/com.pmss.UserInfo}: java.lang.NullPointerException 12-11 22:42:30.949: E/AndroidRunt...

0
Q: MySql. PHP script check If user is in database

Rimantė BaltiejūtėI'm creating app for Facebook, all users who used app are written to database. So I need always check If user already Is in database, how to do that correctly? So I have variable $name = $user_profile['name']; It get user's name This is my function to insert user to database. $mysqli = new...

0
Q: mysql_fetch_array() expects parameter 1 ? how to fix?

user3076307Hello Im getting this error Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Dynamic [PHP WEBSITE]\includes\main_content.php on line 15 Anyone fix this code.. Here is my code <?php include("includes/connect.php"); $select_posts = "select * from p...

0
Q: Simple Javascript not working in Wordpress / WooCommerce plugin

user3091466The code below is for a simple plugin that adds a new tab to the wooCommerce product page (frontend), and then adds a button to that tab. What I want it to do is popup an alert when the button is clicked. This is super simple, I know, but I created it to try and figure out why a more complicated ...

0
Q: Get data from remote php file

user2570586I've a remote php file with some parameters in URL, this file shows PHARMACIES in COUNTRY selected, example: http://www.mydomanin.com/data/pharmacy/get_pharmacy.php?state=THE_STATE&country=THE_COUNTRY And the server display a HTML table with this data in 4 rows, based in current date. STATE: S...

0
Q: I am still struggling to pass JSON data to another page. Any ideas how this is done?

Chidi OkehPlease forgive me for too many posts. When a user clicks the btnValidate button, a call is made to a webservice. Here is that code: $("#btnValidate").click(function() { // Creating variables to hold data from textboxes var uname = $("#user").val(); var upass = $("#pass").val(); $.post("Autho...

0
Q: Escape and sanitize contact form entries

block14I have a contact form that I would like to clean all entries for security reasons. Following is what I have done so far. I am using this PHP to start with: $f_name = cleanupentries($_POST["name"]); $f_email = cleanupentries($_POST["email"]); $f_message = cleanupentries($_POST["message"]); $fro...

0
Q: Add New HTML Row & Insert Into Database

Andy NaylorI have the following js file: function displayResult() { var table=document.getElementById("addTable"); var row=table.insertRow(2); var cell1=row.insertCell(0); var cell2=row.insertCell(1); cell1.innerHTML="<input type='text' name='expense[]' style='padding:2px;' size='80'>"; cell2.innerHTML="<d...

1
Q: Create json structure with PHP and update datas

Clément AndraudI'm using symfony2 and i need to create a json structure like that : { "map": [ [ X, 1, 1, 1, 1], [ 1, 1, 1, 1, 1], [ 1, 1, 1, 1, 1], [ 1, 1, 1, 1, 1], [ 1, 1, 1, 1, 1], ] } I need to generation this array for then save to a file .json.. In this ex...

2
Q: What is the difference between the bcrypt() and the crypt() methods?

baihuI was wondering what is the difference between these? I was having a discussion with someone about the crypt method and he was talking about the bcrypt method but to me it sounded like they are the same methods. Thanks

1
Q: What is the best way to resolve a relative path (like realpath) for non-existing files?

Frank de JongeI'm trying to enforce a root directory in a filesystem abstraction. The problem I'm encountering is the following: The API lets you read and write files, not only to local but also remote storages. So there's all kinds of normalisation going on under the hood. At the moment it doesn't support re...

 
3:15 PM
ping
 
0
Q: PHP XML DOM looping through complex xml records with varying levels

Stephen KennedyI'm completely unfamiliar with PHP XML DOM, Any help appreciated. I've been using the site and going through previous answers on this, and anywhere else I could find online, but I can't seem to find a good PHP XML DOM tutorial, my ultimate aim is to take a complex XML and use PHP to upload this ...

0
Q: Admin Login Load() SMARTY can't get the GET

the_Xfirst I have to use PHP4 and SMARTY2. Yep I know it is very bad :-/ but we're unable to upgrade cause the existing systems need that environment... :@ I want to code a admin login with jquery's load and php. There is a 3 part Login cause of the tpl system of smarty: a smarty login (with php and...

0
Q: Magento: logon at all sites at once

user3091605I have more magento websites on one domain like this: domain.nl/shop_0 domain.nl/shop_1 domain.nl/shop_2 domain.nl/shop_3 i have already shared customer accounts. but when i logon, for example, at shop_0, i am not automatically logged on at the other shops. I hope you guys can come up w...

0
Q: create time stamp and compare time by mysql field

peiman F.there is a table with these fields month year day and these files are contain numbers like year = 2001 and month = 10 and day = 25 and i have time stamp in php so i need to compare these in mysql something like: select * from times where mktime(year,month,day)<1235478554 is there any...

0
Q: Zend Framework 2 - How to use an external library

DimiI want to add my custom class "Authentication.php" to my project but I don't understand how I have to do it ? I have read many howto about the external libs but nothing work. ZendFramework/module/Firewall/Module.php class Module { public function onBootstrap(MvcEvent $e) { $eve...

0
Q: Userinput to JS onclick not working

Steven VanerpNot sure how to describe the issue without simply stating that the code is not working as intended and I'm at a loss as to why. Everything seems in order and I've had no issues with it before. PHP Script $voterid=$_SESSION['userid']; print"<div class='voteblocks1'><img src=\"images/icon...

0
Q: PhpMyAdmin MySql #1286 - Unknown storage engine ''

user2099491I've just installed, apache2, mysql, php and phpmyadmin onto my Raspberry Pi, I've tried creating a table in phpmyadmin and no matter what I try to do, I recieve the following error: 1286 - Unknown storage engine '' I have tried looking for a solution but all results turn up #1286 - Unknown st...

0
Q: PHP myadmin 404 when opening table

MinecraftonianI don't know why this happened but for some reason when I open PHP myadmin in brower it will load fine. When I try to open a table I get a 404 error. Any ideas as to why this is happening? I am using XAMPP on Windows 7 for future reference. I have looked everywhere to no prevail.

-2
Q: send an email to multiple names from a file and change the ending

user3091667can anyone help me? Im trying to send an email to multiple names from a file. I want to grab all the names and take the .pdf off the name and add the @email at the end. Can someone send me in the right direction with this? Thanks

0
Q: redirect back to page after php code

MrtnI am trying the following code to update external content inside a div named "content1" ajax.js: var ajaxdestination=""; function getdata(what,where) { // get data from source (what) try { xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); } c...

0
Q: Tips on how to create a good structure for answers and questions

Stefano CerelliI need to create a web app where people can ask a question and "randomly" they recieves an answer. Let me explain better: i've a pool of answers and i need to intelligently choose one of these and then show this one to people when they did a question. my first idea was to create a field in DB ...

0
Q: How to make the receiver e-mail dynamic in codeigniter

MichaelKI have a e-mail controller which handles the e-mail. Now, I want to read the receivers mail from the database. This is my code //Send email $this->load->library('email'); $this->load->helper('email'); $this->email->set_mailtype("html"); $FLnames = $this->input->...

0
Q: bootstrap 3 - page content not displaying

user3050023I created a Wordpress theme with bootstrap 3 using the following instructions: http://www.creativewebdesign.ro/en/blog/wordpress/create-a-responsive-wordpress-theme-with-bootstrap-3-header-and-footer/ The content isn't displaying on any pages. I'm not sure if there is a problem with the contain...

-1
Q: Collect information from two tables in foreaches

user2948950I have the image product ID in one database table and the image Source in another table. These are all put into an order. There can be more than one image in a single order. I am trying to send each picture to Pwinty. So for each image I need to make this: $photo = $pwinty->addPhoto($order, "$...

-2
Q: PHP Script to delete files in a directory at midnight every day

flinx777I am trying to create a PHP script (or cron job if that's a better approach) to delete all files and directories in this directory every night at 12:00am Central Time Zone. I'm working in a LAMP environment. The directories I want to delete are in a "cache" directory located here: core/cache ...

0
Q: PHP arrays - sorting (highest to lowest) by value calculated outside the array

Alex HoggProblem: I need to sort the array (contents shown in bulleted list in the order they appear within the array) into order of the numbers on the left-hand side (highest to lowest). The numbers correspond to the number of divisions within the directory path on the right-hand side (They are not sto...

0
Q: The EditText didn't have any data that I retrieved from my own database

NickThis is my UserInfo.java public class UserInfo extends ActionBarActivity implements OnClickListener { EditText nametext, useridtext, passwordtext, mobilenumbertext, addresstext, citytext, postcodetext, statetext; Button update; SharedPreferences sp = PreferenceManager .getDefaul...

0
Q: PHP multilingual site with mo

ZiaI want to make a site available in three languages, in my knowledge I can use three way to achieve this. With .po and .mo file like wordpress. With php array dumping in html file. With storing a labels in database. The database may be increase with large amount of data. My Question is what i...

0
Q: How to use the php that brew installed?

kramer65On my mac I've got php installed and working fine. I recently wanted to install mcrypt, so I did so using brew. Although it seemed to install fine, it doesn't show up in my phpinfo(). So I think that the php that brew installed mcrypt in, isn't the php that apache uses. Does anybody know how I c...

0
Q: PHP compare dates

Tomaziok basically I am trying to compare today date with a database date and determine if today date is > then one of the dates in database. but no matter what date is picked up from datatabase < or > compared to today the result is always true. Could some one pleas have a look at my code and point ...

0
Q: Ubuntu mysql database doesnot recognise spanish accent characters

db1I have a problem with storing spanish text in mysql database in Ubuntu. The spanish accent characters like ñ are displayed incorrectly as "ñ" This happens in production not in development environment. I know that this is not a mysql database issue. Since both development and production databas...

-3
Q: PHP Code Within Element Causes Repetition

user2737457I'm finding that placing php code snippets within my website's & tags is causing a problem with the code after it's placement. I first noticed it when placing avatars on my site in a list format where it works fine up to a point and then the same image is repeated for the rest of the list. Her...

0
Q: PHP charset having issues

user3065191I don't usually have issues on charset, but this one I'm not getting where the problem is. function categories($host, $user, $pw, $bd){ $file_handle = fopen("categories.csv", "rb"); $mysqli = new mysqli($host, $user, $pw, $bd); $mysqli->set_charset('utf8'); while (!feof($file_h...

0
Q: when using add_user_to_blog getting error "Call to undefined function get_userdata"

Mahesh BudetiI am working on WordPress MU and trying to build one plugin to add user to multiple sites. so far did everything to loop through sites. But while assigning user to site as below using add_user_to_blog am getting error see below. add_user_to_blog( $blogid, $amsuserid, $urole ); Getting the foll...

0
Q: While loop into a switch in PHP?

user1648471I am trying to make a website in different languages and I retrieve this information from a database. For now I have two languages in there: English and Dutch. What I would like to do is getting all the language possibilities and put this into a switch. So if people will click on for example thi...

0
Q: Need help in connecting of Android to wampServer (MySQL using PHP)

user2618894I am new to android development. I have a website already setup which uses mysql database. I want to know how can i connect my app to that database to get a table from database by clicking on button. What i wanna achieve is that clicking on button on my app should pick the table from database us...

1
Q: Trying to 'git pull' from PHP script, running into SSH permissions problems

David E. SmithI'm stumped by this code, which works locally but not remotely. <?php shell_exec('/usr/bin/git pull ssh://my.git.server/git/test-theme /home/dsgit1/wp-content/themes/test-theme' 2>&1); ?> (It's eventually going to be part of a WordPress plugin, but since I'm not using any WordPress-specific stu...

0
Q: how do i order my live feed with the LATEST data first

user3091728I would like some help to order my live feed by the latest information first! How do i do this? I am new to php so have tried googling some methods but I am not getting much luck.

0
Q: strftime not displaying current date

AdityaIf I use $end_date_formatted = date("F d, Y", mktime(0, 0, 0, $month_end, $day_end, $year_end)); it returns correct date based on values of $month_end, $day_end, $year_end. But if I use setlocale(LC_ALL, 'fr_FR'); $end_date_formatted = utf8_encode(strftime("%d %B %G", mktime(0, 0, 0,...

0
Q: A simplepie rss feed of forum posts has stopped working

user2992596This question probably couldn't be much more of a specific problem, but I have never worked on this project before, and I've never worked with codeigniter or simplepie. The problem is that after my host changed my servers I.P. address, a specific part of my clients website which was getting an RS...

0
Q: need assistance registering a database

user3047348hey there i did a pdo registry system - but i used three classes instead - but I am not getting it to insert the email/password into the registry - it just enters a blank screen!...no input however..so here are the codes for the 3 classes below: connect.php <? php class Connect{ publi...

0
Q: How to rewrite HTML in to PHP echoes?

JamesI am trying to split my last post into more sections. I am working with AJAX & Database. The goal is to a have a clickable division (button) in a view. When this div is clicked the AJAX query is called and retrieves 5 movies from my DB and displays them in the view. What I am struggling the mos...

0
Q: PHP Obtain client location

user2073973I'd like to know how to obtain the location of a client. I know this is possible by simply tracing the IP, but this isn't very accurate. I noticed http://www.kickstarter.com/ was able to get my exact location. I tried it in 2 different browsers, cleared my cookies and all, and it was still able t...

-1
Q: unexpected T_CONSTANT_ENCAPSED_STRING error on include

user3091805if(isSet($_GET['name'])){ if(checkname($_GET['name'], $paths) === false){ include "nofile.html"; } The error occurs on include "nofile.html"; line. Any advices?

0
Q: Inserting data into two databases, where one is a third party

Jack HarrisI need to insert data into two different databases. One is locally, and the other is a third party CRM that provides me with path to their php file. This is the code I am right now using to insert data into their database. <form accept-charset='ISO-8859-1' enctype='application/x-www-form-u...

0
Q: foreach not iterating each element as in var_dump

Bit ManipulatorI have made a simple app to fetch wall feeds using facebook graph api and displaying the result obtained using var_dump. It has 97 elements. But when I iterate over it using the below code, it shows only 22 elements. // a snippet of code var_dump($user_feed['feed']['data']); foreach($user_feed['...

0
Q: JSON sending data through form

Patrick AkkersI bought the uploadifive script and want to change some things. I've added a textfield called "name" and a textfield called "about". The basic script that comes with Uploadifive is: <script type="text/javascript"> <?php $timestamp = time();?> $(function() { $('#file_upload').upl...

0
Q: Insert into array by spaces

Nir TzezanaI have this TXT file, which each line I would to insert into array, like this: Array ( [0] => [1] => 8100 [2] => 623 [3] => 09:04 [4] => AM [5] => 00:26 [6] => L [7] => S-ED [8] => 768 [9] => #4506856439 [10] => 00:01 [11] => ) CO USER TIME DURATION TYPE ACCOUNT_CODE ...

0
Q: how to parse a json mailgun sendmessage response in php?

The Newbie QsHere is my code: $this->view->assign('mail', $mail); $mg = new Mailgun($this->getMailgunAPIKey()); $domain = "sandbox1111.mailgun.org"; $res = $mg->sendMessage($domain, array('from' => 'bob@sandbox3445.mailgun.org', 'to' => 'mee@...

0
Q: Magento: How Add Categories of items using ModulesCreator

Jean-philippe EmondI have created a plugin using Modules creator in Magento but I need to create a categories of the items. I have already modify the installer and also the .xml for the top admin menu. but now I don't know witch file i need change to add "Categories" for the items. thanks for your help!

-1
Q: Include the PHP file only once for all AJAX Calls

rk1708I am including 3 different PHP files on a page index.php using ajax on 3 different button clicks, but all these PHP files further requires another PHP file, lets say it a.php So in this case I've included a.php in all three files I'm calling with ajax Including a.php in all three files is not t...

0
Q: Form still redirect to PHP with preventDefault

st1ph1nThis is my first post on this site. I have been reading it for a long while though. I am working on a login form utilizing jQuery, AJAX, and PHP. Several times now I have run into the problem where I am redirected to the PHP page where I see the echoed data I wanted returned. I have tried to fig...

0
Q: enable crt key verfication in CURL

samithaI get my xxx site crt file and made bellow code to work with CURL.unfortunately it does return bool(false) when i var_dump($server_output).Why ? $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://xxx/xxx.php"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, tr...

0
Q: Magento Grouped Product Not showing products / prices

tsantosWhen building a new grouped product using already created and in stock simple products the finished grouped product not show the table listing the product titles and prices on the right side column when using my custom template. When the custom template is turned off and the default Magento tem...

0
Q: Javscript redirect page after Submitting Form

JohnFirst of all let me say, I can find all answers on stackoverflow, so this one is basically to get started as an "active member", cause it seems without posted question I cant give you my votes ;) So, I have a form, which can either be submitted via AJAX or usual way, working with the submit butt...

0
Q: Filtering out a JSON result with PHP (or just in JS)

Paddy CallaghanSorry if this is similar to other questions but I can't seem to find a response to what I am looking for in other examples. Before anyone yells, I am using PHP4+ not 5 yet (I can't go into the reasons :( ) Ok, so I am building a calendar using the fullcalendar js scripts from http://arshaw.com...

0
Q: Authentication from sub-folder non-wp cookie Wordpress

user3091886I have a little problem with the user authentication in my WP MUltisite site. My site is http://www.drezzy.it that have a own user db with a login and logout system. This is a non-wp website. When you login, it gives a cookie wich include the email and the password of the user. I create a WPMU ...

0
Q: SQL Error message:

DanishcjI am getting this error message when i press submit on the form: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2013-12-10', '', 'dsffsd', 'dfsfsd', 'sfdd', 'sdffsd', 'sdfsdf', 'sfdsdf', 'dsad' at line 8 ...

0
Q: shell_exec not working with .sh scripts

jazeanI have a php file hosted on apache server in Ubuntu. Everything works fine apart from shell_exec('myscript.sh). If i execute anything like shell_exec('dir'),shell_exec('ls') etc.. works fine. But only when i am executing a simple shell script through shell_exec it doesnt work. For simplicity i ha...

0
Q: If $this starts with 'x' in foreach?

SamPi want to match a $this value in a foreach loop to a string in an if/else statement, but I can't seem to get any output? In Javascript this logic should work, but in PHP it doesn't. Every iteration should check if the current value has $startLetter as a first letter and, if it does, it should ech...

0
Q: How Can I make portable xampp project

user2958359Let I have developed a dictionary application in mysql using php in xampp. That is i can access it using localhost from my browser. But i do not want it to be online. I want to release an offline version of it. So that I can distribute the project using cd or pendrive and user just take it and ru...

0
Q: Output links in php

C-MI've got a piece of wordpress code that outputs a string (which is a url) I need to convert this output to a link. echo get_post_meta($post->ID, "Link", true); The code is already inside tags as there are other php calls in the file too. How do I modify the code to output a link? Thanks

0
Q: How to download files to the client?

user3091885Problem Description:Here's a file, http://www.demo.com/demo.zip, how customers can through the website: demo.zip to download this file? How to write this download.php, thank you very much

0
Q: Codeigniter ORM unable to ceate relation

maak.Trying to establish a simple multiple relation between two tables. Unfortunately Codeigniter keeps saying: "Unable to locate the model you have specified: eventtrigger". Here comes the code: class Task extends DataMapper { public $has_one = array('employee', ...

0
Q: How do I get values from a batch program in PHP?

Will MacklemoreLet's say I have a batch program saying this: "Your database name: " The user will input the database name. This would then put the database name into an array in config.php. Is something like this possible?

0
Q: Trying to get boolean value for session

user3086373This code is outputting session variables i am trying to get the access level and put it into a session i already have an output for my username and password. I am trying to write a sql query that will retrieve the boolean and output it to Session_Access if($count==1){ echo '{"response":{"error...

0
Q: Long-lived access token and page tab: make it expire

binocularsMy app runs in a Facebook Page Tab. On the landing page, I log the user in using the JS SDK. On the other pages, I want to avoid ugly error messages (for example when the access token get's invalid), so I put this on top of every page: require_once('initiate_fb.php'); if($facebook->getUser()=='...

0
Q: Json response error JSON.parse: unexpected end of data error

user3091928Hi friends I am having a weired error I am using ajax to get the data from other file that is using php query it returns a json_encode but json.parse is having a problem...... here is my code.... $.get("pgs/dpg.php",{pg:"18", type:"rec", obs_code:$("#obs_code").val(),lib_code...

0
Q: test a connection to a network device using snmp

KoenI have this code to retrieve some countervalues of a copymachine. foreach($sett as $key => $value){ if (intval(str_replace("INTEGER: ","",snmpget($ip, "public", $base.$value["MIB"])))) { $c = intval(str_replace("INTEGER: ","",snmpget($ip, "public", $base.$value["MIB"]))); $error = false;...

-2
Q: PHP - Check if event is overlapping another one

Frederick MarcouxI'm currently developping an event management system for my client but I'm stuck at one place. For each event, we need to specify the local where the event is happening. This should also be verified. I need to be able to add an event and check before saving if the event is not overlapping anoth...

0
Q: Remove parent from custom post type

tmyieI've created a new custom post type with WordPress. However, the slug adds the post to a parent, like so: http://example.com/UNNCESSARY-PARENT/post-title However, I'd like it to create: http://example.com/post-title Is this possible? This is how I've registered the post type: function create...

0
Q: Count one table and ORDER BY it

user3091918I want to order my blog posts by the amount of comments. To retrieve my posts etc i use: $result = DB::query("SELECT R.rumorID, R.rumor_author, R.rumor_title, R.rumor_text, T.topic_name, A.first_name, A.surname, T.topicID, R.datum_geplaatst FROM Rumor R JOIN Account A ...

0
Q: : mysqli_stmt::fetch(): Couldn't fetch mysqli_stmt error in my code

Saulius SlavinskasI have two mysqli queries. While the script is looping through the first queries result, the second one is executed and that's where this error is shown: "Warning: mysqli_stmt::fetch(): Couldn't fetch mysqli_stmt". Here is my script: $stmt = $db->prepare("SELECT post_id, user_id, time, post...

-2
Q: create a compiler (C,c++,Java) with symfony

EL OISSIFI AhmedI am working on a project (website) with symfony2 of a competition in coding (C,C++ & Java) and I need to create an online compiler . How can I do that ?

-1
Q: Search for instagram pictures using hashtags with PHP?

user2984757I've seen API code posted on how to retrieve photos using hashtags but I don't know the exact PHP code. The code shown at Take all photos from Instagram who have the specific hashtag with PHP is really useful for displaying pictures, but I'm looking for a PHP code that will allow me to display a...

1
Q: using strftime for 31 december shows next year

AdityaUsing this code, setlocale(LC_ALL, 'fr_FR'); $end_date_formatted = utf8_encode(strftime("%d %B %G", mktime(0, 0, 0, $day_end, $month_end, $year_end))); strftime is not returning the right year only for Dec 31. it should display 31 decembre 2013, but it displays 31 decembre 2014

0
Q: Date Picker Range Filter table data in row

user3091940I need to create a filter table data in accordance with the selected date "from" date and "to". I tried to find out what dates selected by the user in the DatePicker, then converted to milliseconds, then determine which rows have a value between them, and display them. We apologize for my English...

0
Q: PHP, Json Not insert With Big Int Value into MySql database

Alex.DXI have this json data : data = {"sec_auth":3bcc8414a4c3fae1d4eff09530d8fe23} Now, When I insert to MySQL database this data value, I see : 9223372036854775807 how to work json for Big Int value?

0
Q: Return FALSE After Throwing Exception

JasonI've made it a habit to include return false; after throwing an Exception in a PHP function, even though the PHP docs state: When an exception is thrown, code following the statement will not be executed, and PHP will attempt to find the first matching catch block. If an exception is not caug...

0
Q: Which is the best way to export a ajax filled table to a pdf file?

ciaobeni've a page with a datatable that load the data with ajax... i need to be able to expert the table PDF, and XLS. Which is the best PHP solution?

0
Q: Codeigniter doesn't find assets(css|js|images)

1linecodeI have the following virtual host config in windows: NameVirtualHost * <VirtualHost *> DocumentRoot "C:\xampp\htdocs" ServerName localhost </VirtualHost> <VirtualHost *> DocumentRoot "C:\xampp\htdocs\example" ServerName example.com <Directory "C:\xampp\htdocs\example"> ...

0
Q: Locating or Establishing MySQL UN and PW after uploading .sql file via phpMyAdmin (Wordpress)

user3092019I've uploaded a .sql file via phpMyAdmin with success. I am currently using a different table in my Wordpress installation, but would like to switch it to the table/.sql file I just uploaded. I know in the wp-config.php file I need to update the following to reflect the new file I uploaded: def...

0
Q: Ensure that there is only one running PHP process on Linux

ZubI have a php script running each minute from cron. but sometimes it works longer than 1 minute. My question is: what is the best way to ensure that only one process is running right now? I use this code: $output = shell_exec('ps aux | grep some_script.php | grep -v grep'); //get all processes...

0
Q: Converting $_POST text input into a multidimensional array

WojtazzzOn my online shop, there's a form with a big number of text inputs, representing quantities of products. There are three fields for every product: quantity of product in S size, M size and L size. So the name of input field must contain both the product id and the size. This is simplified code o...

-2
Q: Names picked at random

user3091952Please someone help me out... i dont really know about php I want to get random names from probably a database or a PHP array script I got a Slot Machine Script that could get random numbers in three different slots.....its working perfectly fine with the numbers but i want to insert names int...

-1
Q: magento get Attribute code or object by label

Roman ffHelp me How can i get magento attribute code or object by label (if exist)?

0
Q: PHP Form submitting to MySQL whether validation conditions are met or not

Vynce82My php self-validating form is submitting to sql database whether the characters entered into form fields are appropriate or not...How do stop it from submitting until the conditions for each form field are met? <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" conte...

0
Q: Error with Relational Table in Doctrine

raygoI'm trying to follow the example from this link to do a many to many relationship with an extra field with Doctrine 2 and Zend Framework 1. My code looks like this: User Entity class User { /** * @Id @Column(type="integer") * @GeneratedValue(strategy="AUTO") */ private $u...

0
Q: Send simple integer from server to arduino with Ethernet shield

FareedI rally need help here. I have a mobile a very simple mobile application that has a button, when the user clicks on it, integer 1 is sent to server. I want to send this integer back to my arduino with Ethernet shield. So it has ip address. but i actually don't know how to send it by php. I'm u...

0
Q: Jqgrid search - server logic

BinaryrespawnI am adding search functionality on an existing jqgrid. I am using codeigniter php framework. Here is my logic. I am harvesting the sql string generated by the jqgrid and sending it off to my controller hence $this->input->get('extra'). I used a java script regular expression to strip off bracket...

1
Q: PHP Simple HTML DOM Select

ice_kernelHave a problem with getting of option tags from page that have 1 select. When i perform my code from console it takes only first option from select. How to get all option??? Here is my code: include './simple_html_dom.php'; function curl_to_SimpleHTMLDom($curl_content){ $HTMLDom_content = new...

0
Q: Function Output Issues

Denver WilliamI have a function that can either be called by echo or load, in turn also 0 or 1 for echo or load. But, since adding the number variable to the function options, it no longer always works. Can you please help me? Here is my function: // GET MAIN INFORMATION function get_info ($KEY, $OUTPUT = 0...

-1
Q: Display Image from mysql database to fpdf

sniI am new to fpdf. i can fetch required data from database and generate the pdf. but i would like to fetch the images from database and display that in the generated pdf. i have stored my images into a image folder. and the image name is stored in the db. please help .

0
Q: Paypal third party carts can discount be sent for individual items

Paul LedgerI have a range of products to send to paypal via a third party cart. I am aware I can set a whole discount for the cart whicg includes every item. But is is possible to set this up for each item or would I have to work out the equations in php and attach the discounted price to the cart data. I ...

0
Q: Concatanating strings with echo

Brad HazelnutHello I have a list of words that i want to wrap around the following characters but i can't seem to get it to work List of words, which are form variables ======================================= fname lname address city state zip i want to wrap each of those in the following and be able to di...

0
Q: Advice for Email Form and Auto Responder?

user3089680I want to create a simple form on my site for visitors to submit their email address. Upon submission, I would like this email to be stored in a database or spreadsheet and also a welcome email sent to the address that was submitted. I also do not want to pay for this type of service. I'm a nov...

posted on December 11, 2013 by TryingToBeZen

I can't tell where I am going wrong with this statement. However I get this error: Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near Here is the statement: $stmt = $conn->prepare('INSERT INTO sub-contractors(first

0
Q: Wordpress REST API Authentication without a login page

eguneysI want to post to my wordpress blog with javascript using the REST api, I understand two step process to get authenticated 1. User sent to authorization page, user press authorize button get a code, 2. Use the code to get an access token . I need to skip step 1. How can i post to my blog withou...

0
Q: ZF2 : How to dynamically connect to database (without global.php)

user2731155my ZF2 application have to connect to different MSSQL databases (about 3000 !) so i cant prepare all connections. (i dont connect to all DB of course, it depends on the user query). How can i do that, within a controller ? (only the DB name changes, server and user are always the same) thx

0
Q: Format of JSON array

xtrasI am writing form data into json file using php. But am getting it in the form [ { "arrayname" : { "name":"abc","marks":"100"} }, { "arrayname" : { "name":"def","marks":"100"} } ] But i want it as {"arrayname":[{ "name":"abc","marks":"100"},{ "name":"def","marks":"100"}]} Am using followin...

-1
Q: In mysql, how to I query to see if a specific user is in a table?

user3092108I have a table of users and I want a query that will tell me if a particular user is listed in the table. For example, in the table below: Users | Ages Bob | 22 Mike | 30 Sue | 21 Can someone help me with a query that does something like, If (In USERS_TABLE, Mike is in column 'Users'){$use...

0
Q: Regular Expressions Preg_Replace() Replacing Exact String

user1216849I want to use preg_replace() to replace anywhere in a string '%z' with '&#378;'. So I wrote: $pattern = array(); $pattern[0] = '/^\%z$/'; $replacements = array(); $replacements[0] = '/\&#378;/'; string = "oraz ró%znego typu innych wydarzen kulturalnych, sportowych i rozrywkowych." preg_replace(...

0
Q: Passing an array to a block in a Magento email template

Srikanth ADI have a block defined in a custom email template like, == Email template == Hello, following are some custom product ids <p>{{block type='core/template' area='frontend' template='company/email/create.phtml' products=$productIds }}</p> In the send email function, I am passing "products" a...

0
Q: oracle display ORDImage in webpage

JackLipariI have a DB table in which I store some images of type ORDImage. Then, on the web site, I'd like to show these images to the user. I have the PL/SQL function that extract the source of the image and pass it via cursor to a PHP page, where I render the image as <img src="path" alt="Pic" /> But ...

0
Q: Uploading images in cross-platform application

OmadeI am creating a cross-platform web application that needs to upload images from each device or platform. I successfully used codeigniter file upload that works perfectly but it does not seem to work well on other devices. I have also used cordova but the does not work on mac and windows system. T...

0
Q: XML - Create element - New line

MichaelHow can i create a new line in an element? I do: $currentTrack->appendChild($domtree->createElement('code', ' test1; test2; test3;')); However it adds &#13; to the end of every line. How can i get rid of that?

0
Q: Symfony2 - form global validation not working if validation group is defined

user0000001I found, that my validation for textarea is not working, if I'm not logged. If am I, it works OK. Here is my Comment.php entity: /** * @ORM\Column(type="text") * @Assert\NotBlank( * message = "Message cannot be blank" * ) * @Assert\Length( * min = "3", * minMessage =...

0
Q: compining correctly javascript with php

user2491321little help here please....I was writting a php script for a message system. comments are displayed in php with the use of $comments through a function. I was trying to use a light box in javascript, so that user will have the option to delete each comment. How can I compine the following php scr...

0
Q: MySQL query array doesn't get populated when called with ajax

user715564I'm using ajax to return the results of a sql query on a WordPress site. Basically, there are two queries and I am displaying the results of the second query. The first query gets a list of posts that contain a certain custom field. The second query looks through those posts and lists out the pos...

0
Q: PHP loop through array then delete the current key

Michael SamuelI have the following simple php loop: <?php $lines = file('test.txt'); foreach($lines as $key => $val) { echo $val; unset($lines[$key]); file_put_contents('test.txt',$lines); } ?> I could put the file_put_contents function after the loop but the problem is that script may fail at an...

0
Q: 3 Issues Regarding .htaccess

LeoI currently have the following .htaccess snippet, I don't understand it at all, and I am trying to simply fix few problems: 1 - How to make www.loaidesign.co.uk and loaidesign.co.uk and both with /index.php at the end to re-direct to the home page? as I have heard it is not good for SEO. 2 - I ...

1
Q: Basic PHP Object Oriented Instantiation and Dependency Injection

Mitch GlennI'm trying to learn to use dependency injection, but am having problems putting it to use. I understand what is happening with the two classes here, however when I go to use them, I'm doing something wrong. class Author { private $firstname; private $lastname; public function __construct($firs...

0
Q: How to visit my first route in Laravel?

kramer65I want to learn Laravel, so I just created my first project in my Sites folder. The folder in which it is in is now Sites/dump/laravel_test/. So following the quickstart docs I made a route in app/routes.php as follows: Route::get('users', function() { return 'Users!'; }) After saving the ...

0
Q: Submit in the same HTML/PHP page without jQuery/Ajax, is iFrame is the only option?

José JuniorI want to make the output of a in the same page of submit, I did it with html , is there any alternative besides jQuery and Ajax? Thanks in advance.

-1
Q: PHP - Check if one of two form fields is filled?

user109899My form has Phone and Email fields. Many people might not be wanting/able to put both, so I thought, that the validator would require only one of those two filled, instead of requiring the both filled. Would this be possible? Here's my validator. Thank you.

0
Q: Problems in implementing Disqus plugin due to jQuery issues

ShanI am working on a blog website at http://d361.azurewebsites.net/Blog. I have used a template for full page flip from http://tympanus.net/codrops/2012/12/11/fullscreen-pageflip-layou which uses javascript and jquery, other than the obvious. I have 2 problems. I need disqus plugin on every art...

0
Q: Google Maps API Key Error

AddramyrI'm trying to connect my PHP script to the google maps API using CURL it connects fine but when i pass the API key it says that it is not valid, below is some of the code I'm using to get stats... <?php $url = 'https://maps.google.com/maps/api/geocode/json?address={ADDRESS}&sensor=false&key=...

0
Q: Calculating average time between unix timestamps

Stinis87I have a database which contains posts that have both a creation date(unix timestamp) and a publication date(unix timestamp). I want to calculate the average time it takes a post to be published after its created. I guess im way off, but this is what i got so far: $times = array(); foreach($post...

0
Q: DB::paginate in Laravel 4 fails

user3092232I am running a typical query on a fairly large MariaDB 10.0.6 database (~2 million records), where I want to have only top few records returned. The 'where' statement I am using will match no more than 5-10 records. This statement fails: $lucky = $this->post->select("ID")->where('luckynumber', ...

0
Q: Reading JS variable

rk22I have the following json file with several information needed in my JS application. Example: var cenas = {"id":"cenas","text":"Insert text here","correct":"true","x":"283","y":"180"}; var points= ['123','1566','125667','433456']; Need to read the file using PHP. Using PHP's json_decode doesn...

0
Q: Adding date value in form in Zend Framework 2

user3092180I'm trying to follow this tutorial but I have problem with applying it to my project. I have a column in MySQL database which is DATE type. I don't know how to insert value into this using ZF2 form. I tried following: $this->add(array( 'name' => 'date', 'type' => 'Date',...

0
Q: JqxChart trying to export into image/canvas to send to Php

PhilI use the JqxChart for some graphics, but I need to export that for print on Pdf or similar. the library http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/index.htm don't get me function or method to export inside the JS. If i write var x=document.getElementById("jqChartRadar"); alert...

0
Q: Call sphinx indexer from PHP

dan360I have a rather large web application that stores large amounts of data in a MySQL database. I also have a php script which does some work on this data. Because the work the php script is quite intense I run this on multiple separate servers. Basically the script programatically downloads a rand...

0
Q: Failing to recursively filter multidimensional array of objects

Lynn OwensI have a variable which may be an object or an array. If it is an array, it will be of objects. Each object may have a parameter which is another object or an array of objects. All arrays may be n levels deep. All objects have a parameter 'isAccessible'. The value of this parameter may be tr...

0
Q: PHP gettext() and an application's native language

Bill DamiI am working on converting an English-based PHP application to use the built-in gettext functions, and have a question regarding its behavior/translation process that I wasn't able to find during my research: Since my localized strings' keys are the english version of the text (i.e. gettext("Hel...

0
Q: Creating an array and obtaining the first value

user1782964I have a database field named 'manufacturer' with some numbers separated by a pipe. e.g 1572|906|1573 I would like to select the first number and store it as a variable. This is my woeful effort that has yielded no success. $thisproductmansarray=array(); //declare the array $thisproduct...

-2
Q: syntax error, unexprected T_LNUMBER php

AndrewDWhen I submit my form, this error is generated and points to this line of code. I just recently edited the point values so I thought I could have entered one incorrectly but I cannot find it. Any help is greatly appreciated. ToPointsPFGE is a function that reads the input from the user (poor fa...

0
Q: PHP - save user input into text file and displayit allowing user to reuse his inputed text

user2858981I have a php script that stores the content of 2 text inputs into a text file when i click "SAVE" How can I do the folowing thing on pressing the "SAVE" button: step1: the text from the 2 inputs are saved in my "file1.txt" step2: the 2 lines of text are displayd in the same page (just like ...

0
Q: C# Query Help Disabling Twice

user3079783Can anyone help me. I cant see why but booth buttons are closing when i do this code? using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) lol = int.Parse(client.ExecuteScalar("SELECT COUNT(*) FROM settings WHERE client_open = '1' LIMIT 1").ToString()); if (lol == 1)...

-1
Q: Get the right function to send one email to multiple filenames

user3091667I have a code that will get the filename ready for email but Im wondering if anyone could help me get the right function to send one email to multiple filenames. Here is the code i have so far. <?php SELECT filename FROM feedback; //you fill the $emails with all the name...

1
Q: $.post return null value

MohammadI use $.post in $.post ! But second $.post return null value ! JQuery Code : var id; $.post('1.php', {id:id}, function(data){ var stat; $.post('2.php', {stat:stat, function(newdata){ alert(newdata); }); }); 2.php code : if(isset($_POST['stat'])){ echo "test"; }

0
Q: Resize image PHP javascript

SethCodesI am using a javascript I acquired online that allows me upload images to a folder with PHP and then I added a little bit of code so I can add the URL to a mysql database. It works perfectly, now I want to try and extend the script and also resize the images being uploaded by 50%, so I can have t...

0
Q: Passing PHP JSON encoded Variable into Javascript code as string

user3078580I'm looking to pass a JSON encoded string in a variable from a PHP script, into Javascript. This is all in the same file. PHP Code $result = mysqli_query($db_connection, "SELECT * FROM feedback"); $finalResult = array(); while ($row = $result->fetch_assoc()){ $finalResult[] = $row; }...

0
Q: Using htmlspecialchars within Query function

steepedInstead of manually adding the htmlspecialchars function to all outputted data, I've been trying to instead just place it in my query method so all returned data will automatically be processed. This is my query method: function query($query, $params=NULL) { $stmt = $this->pdo->prepare($que...

0
Q: Write MYSQL query to CSV file can't write query

user3092297All of this resides on an ubuntu LAMP server. I am trying to put the results of a sql query into a csv file. The php can query the db and create the csv file. But I can't get it to write the results to the csv file. <?php //connect to db and query $db_conn=mysqli_connect(xxxx, xxxx, xxxx, xxxx)...

0
Q: PHP selecting duplicate records

AlihamraI have the following mysql table : id store_t item qty 1 M5 xx 2 2 M5 xy 4 3 M8 ze 10 4 M5 zz 1 I want the table output to be like this : M5 xx 2 xy 4 zz 1 M8 ze 10 What i am looking for is to find a way to group and select th...

0
Q: PHP preg_match: exclude whitespaces

AskelonI'm working on some code block that validates a config file containing PHP variable. I want to detect variables left empty using preg_match. If the file contains the following lines: $db_host = "blablah"; $db_host ='blablah'; $db_host=''; $db_host=" "; $db_host=""; I'd like to match...

0
Q: how to use your own functions and/or classes in Zend Framework?

Justin i have been creating my set of functions since i started coding and i want to use these functions throughout my project in Zend Framework 1.12 i know i can place in a folder that i would create in the library, however i am looking for a different way to use my functions. if i placed my functions...

0
Q: How variables save non-scalar data

ANWI am a bit confused as to how variables store data of a text file into memory. EXAMPLE: <?php $varContent = 'book.txt'; Now, what I would like to clear out is that, what gets stored in $varContent? is the the simple string name 'book.txt' or does the file type, header, information inside ...

0
Q: Decoding a json array with certain objects in Android

VivekSo, I am sending the below data as a json response to "client.execute()" method in Android code. [{"groupId":"26","adminId":"9033033177","userId":"9913365515"},{"groupId":"26","adminId":"9033033177","userId":"9898495272"},{"groupId":"26","adminId":"9033033177","userId":"9033033177"},{"groupId":"...

0
Q: Wordpress paginate_links - first page always the same as current page

raisonI have a custom loop in wordpress and have added pagination to it. I have permalinks set to pretty (eg /custom/). I have the custom loop set up so it can work despite not being the primary loop. Currently the loop works perfectly by appending ?paged1=[number] and taking the loop to the correspon...

0
Q: Getting weird error trying to extend the template

yefremI'm developing quite simple application using Silex and Twig. I created two basic templates: layout.twig for front users and admin_layout.twig for admin area. I have only few templates that extend these two ones, 2 for layout.twig and 3 for admin_layout.twig. And some of them show some strange er...

1
Q: How can I store a private api key in a source file?

JackI have an open-source project on github that, amongst other things, communicates with the github API to get information. It's working fine, but I'll need to use at least basic authentication, due to the potential number of calls to the site. I don't want users of my script to have to create th...

0
Q: imagecreatefromjpeg returns false, but works if I don't check for false

RISC OSI'm trying to make a thumbnail of an image. Here is some sample code that doesn't work: https://gist.github.com/riscos/7915337 Here is some sample code that does work: https://gist.github.com/riscos/7915348 What I don't understand is why it doesn't work. Both scripts use the same file and s...

0
Q: PHP upload 512MB files library

El DudeIs there a php backend library that allows a user to upload files upt to 512mb big and displays the progress in a bar through jquery / javascript? Thanks, EL

0
Q: Need help - Replacing DIV content with data from DB without refresh (using - jquery, hmlhttp, CI)

JamesHere I go again. I am trying to change content of a division with data retrieved from my database. This has to be done without reloading the page, therefore I am using xmlhttp and javascript. The website is running on CodeIgniter. Below is the code with a short summary of it. I have been followin...

0
Q: Reuse Database Connection When Creating PHP Objects

PakaIn PHP, I have two classes: Database and Item. Database contains the connection properties and methods. For example, Database::Query can be used to pass a query string, etc. Item is a generic item identifier. It's built by passing it an itemID which is then used to query the database for the re...

0
Q: PHP - Why i cant insert information into my table?

user2727351Im trying to insert information into my table, using classes and functions. I dont know why, but my function doesnt work, but it recognizes my database. Its giving a error message when i submit the form. What do i need to change? Here my form page code: <?php include("BDMySQL.class.php"); ?> <

0
Q: PHP plus RegularExpression parse

user3065191I've regex a file until I got this (example): December Street etc 500-111 New York USA January Street etc 111-999 Russia Russia As you can see, the items are splitted in 4 to 4, the first line is the 'Month', the second the 'Street', the third 'Postal code', and fourth 'Country'. That said, I...

0
Q: PHP: making changes locally

Ignas DamunskisI used AJAX on button to make database changes without refreshing page, but then I have to refresh just to see the changes on page. What should I do so changes would refresh locally (if not possible, maybe refreshign programmaticaly?)? <button style='position:relative; left:15px; float:left; pad...

0
Q: save header in a variable using php

user1974277I need help saving one header in a variable using php. My problem its that i have a header called x-wap-msisdn, and this header content a information that i need. My question its how can i get that header using php? thanks for your help. pd. I use this code to be sure that i have that header: <...

0
Q: Issue setting z-index and class via php

Jack SniperI have a bit of php code that sets the z-index and class of different tabs options within my menu in a header file. The header file is included into every page, then this code will determine what tab is active so the z index and css can be changed. My problem is that this code, no matter what $ur...

-1
Q: Creating a class in PHP first time OO

user2287474Ok, this is a really, really newbie question, but I've googled and tried several different way of doing this with no luck. My first time making a class in PHP. I'm making a simple class that will query an e-mail to a DataBase and it will return if the e-mail exists in that database or not. Here i...

0
Q: Jquery function not working in php

Brad HazelnutI have the following php page and for some reason the jquery function i have doesn't work, can someone please help me with this, by it doesn't work, i mean when i click the button it doesn't do anything: <script type="text/javascript"> function CalcSubTotal() { var total = 0; ...

-1
Q: way2sms api for php

user3092376I want way2sms api for my php project. I were searched google and find out this one link but it wont works. Is there any working way2sms api for php . Thanks

0
Q: Check for a many to many relation when listing a resource

Tamas PapI'm implementing relationships in Laravel's Eloquent ORM, and I'm facing the following problem: An article can have many followers (users), and a user can follow many articles (by follow I mean, the users get notifications when a followed article is updated). Defining such a relationship is eas...

-2
Q: Check Positive Float value in php

Himalya VashisthaI have a variable as $x=some_float_value. So how can I validate or check that $x is a Positive Float. For Ex. $x=-4.99; function checkFloat($x){ /////return true if it is Positive } Please Tell me how can i do this.

0
Q: Name of a href tag

user3027309I'm a complete newbie with regular expressions and I feel bad about it now, when I need some serious advice on how to extract a link name out of an ahref tag, ie. <a href="article.html?id=1999874">This article is cool</a> and I would need to extract "This article is cool", minding that "articl...

0
Q: Form based webpage/application to build mySQL Queries to retrieve results from DB

user480551I have a set of mySQL tables and I need to build a webpage to allow users to build their own query. Example, User requires: "Give me the set of subjects where value 1 = xxx and value 2 = yyy" My idea : Get all the subjects -> Filter for value 1 = xxx -> Filter for value 2 = yyy (The reason is I...

0
Q: Which comes first, PDO::rollBack or __destruct

MikeWhen you run PDO::beginTransaction, if for any reason the script ends and the changes haven't been explicitly committed (on error, exception, exit/die, etc), the transaction will be rolled back. Similarly, when the script ends, any __destruct methods present in any objects will likewise be execu...

0
Q: mysql date literal using the date keyword

robert rochaMySql manual states: As a number in either YYYYMMDD or YYMMDD format, provided that the number makes sense with regard to using temporal literals in the form: 830905 would be equivalent to 1983-09-05. Then why doesn't this code work?: SELECT DATE 830905; And only the string version work?: ...

0
Q: Get last insert id from last inserted row

Marco CI'm here again and I'm getting crazy! I have this stored procedure: CREATE DEFINER=`root`@`localhost` PROCEDURE `aggiungi_categoria`(IN `id_categoria_principale` INT, IN `nome_categoria` VARCHAR(150), IN `sigla_categoria` VARCHAR(10), IN `stato_categoria` INT) NOT DETERMINISTIC MODIFIES SQL...

-3
Q: How can i create a cookie for tracking the browsing habits of users

user2406597I am doing this project for a client and he wants to generate business by knowing that what his website users are searching on the internet in term of the product he is selling. How to create a persistent cookie that can track the browsing habit or pattern of a user, and when i am talking about b...

-1
Q: how to use or / || in php?

Samuel KoppnerI am trying to echo a message if one of 2 statements are true. In this case to do: echo("It's the weekend!!! Party Time!!"); if ($today == "Saturday") or this ($today == "Sunday") is true. The code looks like this: $today = "insertCurrentDayHere"; if ($today == "Friday"){ echo("It's Fr...

0
Q: Using ASP on PHP Platform to Send API

ViviDVasTI need to send API to a third-party software via ASP, but my webserver is PHP. Is there a way to piggy-back ASP on php? I can't use PHP because they reference an ASP dll, etc. For instance, I want to CONNECT to the 3rd party, and then send via ASP similar to as follows: private void createNew...

0
Q: simple & compact code for compressing DNA-like strings

AwokeKnowingmy app is multiple choice test, where for each question the response results in a 4 letter string "eg" GTAC or ATGC or CATG, etc. There are always just 24 questions. so the final result is something like GTAC CATG TACG GACT GTAC CATG TACG GACT GTAC CATG TACG GACT GTAC CATG TACG GACT GTAC CATG...

0
Q: Script that uses cURL will not execute

LanceI'm using a script that connects to Instagram via cURL with PHP. I won't include the entire script since it's too long. But, I'll include some very basics. In this part, a user is logged in. $c = InitializeCurl('http://instagram.com/api/v1/feed/timeline/', true, '', $agent, $proxy, $auth, $cooki...

-1
Q: How to get the exact value from a column with php

AdrianI want to get the value from a column in a mysql table. The value from the mysql row is a simple number of 2 figures. (40) I tried: $healthh = intval(mysql_query("SELECT health FROM users WHERE username = ".quote_smart($username)."")); and in print_r($healthh); I get 33 instead of ...

0
Q: PHP change upload location to another Webhost

CosminI have this code from HipUpload v2.1 and i want to know if i can make the code upload files to another webhost different from the one the fileshare site is. <?php // Uploadify v1.6.2 // Copyright (C) 2009 by Ronnie Garcia // Co-developed by Travis Nickels if (!empty($_FILES)) { $tempFi...

0
Q: Pass a PHP variable from a loop via an onclick

TomThis may have been answered elsewhere but I couldn't find a question which fit my circumstances. I have a site page which out puts in DIVs records from a database, this the same DIV looped. In this DIV I have a button which brings up a modal box. This modal DIV however is not coded within the l...

-2
Q: PHP date() returns time wrong

KeirDavisWhen using PHP to do time() and store it in a MySQL server and then retrieve it, when I try to convert it into seconds, it returns strange results. 1386787112 = 35 seconds ago (What my PHP says) 1386787112 was actually 1 second ago (What my current time says). $da = date("i",1386787112); Thi...

0
Q: Dynamically created Variables in PHP produce occasionally names like "_GET" or "_POST" instead of the variable names

ThiloI have a function from which I call many different variables, and produce another (dynamically created) return variable. All good. (I explain my Problem below this PHP 5.3 example) function showArrayIntersection($ar1, $ar2) { $dynamicName = array_search($ar1, $GLOBALS) . '_' . array_search($...

0
Q: Make arrays as links and open content in new window

madzforeach($output['results'] AS $result) { foreach($result['printouts']['Covers topic'] AS $topic) { echo "<br />".$topic['fulltext']; } echo "<br />".$result['fulltext']; } And the output is Course Name A Textbook 1 Textbook 2 Textbook 3 Course Name B Textbook 1 Textbook 2 ...

0
Q: Compare Two Array - Delete Matching values

DravenI need to search $array_2 for a json_encode()'d value from $array_1. If item_id in $array_1 does not match the item_id in the some_field field in $array_2 then I need that array index so I can insert that into the database. $array_1: Array ( [0] => Array ( [id] => 34 ...

0
Q: User decryption/encryption in PHP | storing key in session

David 天宇 Wongso I have this website that allows users to write every day. It then get stocked in a database in plain text. It's not a blog so everything is private, and the biggest complain I regularly get is that "I" could still read what they wrote. It was still not "perfectly" private. Also I don't want to...

0
Q: How to iterate through database results, compare each value to that in an array and return the matching id?

user3092356This is my first post, so please bare with me. I apologise in advance if this question has a ridiculously simple solution or I don't explain myself very clearly. - Also, I am, for the most part self-taught, so sorry if my work is sloppy. I am trying to build a function that will be given an arra...

0
Q: unable to call illuminate class from resque worker

arrowill12I have just started using resque in my application, I have created a worker and can queue jobs up. I am having issues though using illuminate classes in my worker. below is the error i am seeing in the worker. PHP Fatal error: Class 'Redis' not found in path/to/worker Here is my worker class:...

0
Q: Sort varchar integers first in mysql

Mr.MI wrote this code to show datas from a wordpress database table in a html table: global $wpdb; $table_name = $wpdb->prefix . 'mytable'; $stats = $wpdb->get_results("SELECT * FROM $table_name ORDER BY cast(alexacr as UNSIGNED) ASC"); $itemnum = $wpdb->get_var("SELECT COUNT(id) FROM $table_name");...

0
Q: using Simple html DOM to extract id

user2996987I'm using simple html dom to extract a users fantasy football team. What I'm trying to do is get the "id" number for each player in the source code below. So for example in the div below the "id" is 121. <div id="ismGraphical1" class='ismPitchElement {"coptr": null, "played": 0, "pos": 1, ...

-4
Q: How to insert Cart data into database

user3087951I've done the shopping cart part and the data need to be entered into the database. The order detail and sales report need to be used and view by the admin in future <?php session_start(); ?> <?php ////////////////////////////////////////////////////////////// // SECTION 1.. if user atte...

1
Q: When to escape data being sent with AJAX

steepedI need to escape text that is being outputted via AJAX. If I submit script to the database, like <script>alert('hello world');</script>, then a popup is executed on the page. This here is my function that is setting the data, and then grabbing data to be sent via AJAX. function add_order() { ...

0
Q: MySQL/PHP - Find from recurring schedule who matches a holiday before and after the date

user3084846I have two tables, holidays and schedules_recurring. The holidays obviously have a set start date and end date. The recurring schedules start at a specific date and in my application, recur every 7 days until the schedule expires. As the recurring schedules start date is fixed, I can't just do a...

0
Q: What happens if my MySQL database goes over hosting limits?

ayanbhuinI have a Linux shared hosting account and in this hosting plan I can use only 25 MySQL databases and maximum size per database is 1 GB. So day by day when information get stored in my database, the database size will increase, so what will happen when my database crosses the limit? Then what wil...

0
Q: How to generate custom page names in wordpress?

CiganaI lost my old website's code and am trying to recreate a function I had created ages ago. I have custom pages in my Wordpress blog: about, work, contact, news as well as posts and subpages. I am trying to manipulate the value of <h1 class="site-title"><?php bloginfo( 'name' ); ?></h1> to displa...

0
Q: php seems to automatically url decode...How can I prevent this:

Chris MuenchRequest POST (via javascript) giftcard_number:%120213001? Response 0213001? It seems %12 is being converted to nothing.

-1
Q: Sanitize User Input via PHP

c0nfus3d1I know this is a never ending battle, and everyone has different methods and opinions... I need a new method of cleaning/sanitizing the user input in PHP. I've had some random files appear in one of my website directories... I'm not sure if it's due to stolen passwords or what, but clearly my met...

0
Q: Remove header of a json file, symfony2

Clément AndraudSo, i have an array in PHP, and i write to convert this array to a json and then write this json in a file .json : $fs = new Filesystem(); $fs->dumpFile('test.json', new JsonResponse($this->data)); I'm using filesystem from symfony 2 and JsonResponse to convert array in json. but with this co...

0
Q: php code unexpectedly printed in window

D-InventorI wanted to test some mysql query's to check how to compare some dates to today's date, however instead of executing the code, a part is printed on the screen. this is the code. <? $db = mysqli_connect("localhost","Username","Password","makeamemo"); $result = mysqli_query($db, 'DELETE FROM `mes...

0
Q: Allow Commas, slashes, apostraphies in text field, but also allow HTML5 to be entered and saved

dante466I want to allow the user to enter in any character and it save, but I also want them to be able to add HTML into the text field and it saves... The user needs to be able to bold words, so I am trying to allow them to use HTML.. Here's what I am doing to grab the value from the input field: $not...

1
Q: Converting MySQL datetime to very specific format for export

user1763897I need to convert data from a MySQL to a very specific datetime format so that it can be automatically integrated into a client's database on a regular basis. I would like to know if there is a way to convert the usual MySQL timestamp in format YYYY-MM-DD hh:mm:ss (e.g. 2012-01-10 10:58:07) to ...

0
Q: Code Igniter Composer Twitter Bootstrap

user2167174Could somebody please explain to me how to integrate Twitter Bootstrap in Codeingniter 2.14 via Composer? I've included composer's autoloader into index.php like so: /************ COMPOSER AUTOLOADER *******************/ include_once FCPATH . 'vendor/autoload.php'; //codeignirer autoloader requ...

0
Q: File_get_contents not working for Facebook link

user3092554I have a problem when using file_get_contents. I have this simple script running: <?php $xml = file_get_contents("http://graph.facebook.com/586012835"); echo $xml; ?> (b.t.w. it's a random Facebook id, not mine) Allow_url_fopen is on and when I try to open other webpages like: http://example....

0
Q: Sending jQuery.serialize form via POST, expecting JSON response from controller

elharionI would like to ask you how could I send ajax request with serialized by jQuery form and recieve JSON response from controller? I have been trying many solutions but none of them worked for me. I have a little experience in that matter. Can you provide any good example? Thank You! Send post wi...

0
Q: JSON.parse: unexpected end of data error Ajax

user3091928Hi friends I am having a weired error I am using ajax to get the data from other file that is using php query it returns a json_encode but json.parse is having a problem...... here is my code....I am reposting this question because i m not understanding why this code is not wrking........ $.get...

0
Q: Call in background php from nginx config

Ken Tang I would like to know if it's possible from nginx.conf config file to call any php or os command with IF statement? i.e. Sending Query String: http://server.com/index.php?cat=15 And nginx config starting process in background server { listen 201.2.18.131:80; server_name ...

0
Q: Is isset() here right? / or is my if-condition wrong?

user3092548i am making a Tube-Site and I can´t finish my code. At the moment I am working on a Favorize-Script, so registered people can "favorize" videos and can see them on a special site. Logically it should not be possible to favorize a video twice and that´s my problem at the moment. But I think my i...

0
Q: Add Google Plus in header in html.tpl.php

user3058875In html.tpl.php I have written : <?php if($front_page):?> <?php print '<a href="https://plus.google.com/109533530102750336693" rel="publisher">Google+</a> '?> <?php endif; ?> but its not working moreover its hanging the home page. Can someone please tell me the correct syntax if it has some e...

posted on December 11, 2013 by Corjava

I'm new to PHP and I have a lot of strings with quazi random characters in them. I want to know how I can check the strings to see if two of the characters match each other. How would I be able to do this?

0
Q: HTML Escaping/Encoding in Javascript/PHP

SeanI have multiple pages of html code saved into a database. I want a file to be able to flip through each of these pages without reloading. I created a PHP file to pull all the pages into a database. The page shows the first page and navigation buttons. There is also javascript to put all the ot...

-1
Q: PHP - Explain this code to me?

user109899Firstly, I know it's a long code, but I'm a total beginner in PHP, and I'd need to build a working contact form with a validator. Found some scripts, and got the contact form working fine. Now it just needs a validator. Found this script from here, but can't understand anything... It's not even e...

0
Q: GoDaddy issues with directory (differences with "webroot" and "root")

user3089039Alright so here's a small explaination. On GoDaddy I have a Linux hosting account, when I am coding a website if i use in my links "/news/news.php" I get an error page or if it's an included page I get errors all over the page while certain parts show (The only part of my page not in an include)....

0
Q: Is it possible to restrict data using the WHERE syntax but on only one field not the entire SQL statement

MrwazsxLet's say you have a table called 'Companies' that has the following fields: Company_id, name and you want to print out everything in this table but you also have another table called emails which has the fields: data_key, data_value, company_id. Now bearing in mind you want to print everything u...

0
Q: php LDAP Invalid credentials

user2241859My code is: $user = 'test'; $password = 'testpass'; $host = '10.1.1.1'; $port = 389; $basedn = 'dc=ci,dc=mycompany,dc=com'; $group = 'Users'; $ldaprdn = 'uid=test,dc=ci,dc=mycompany,dc=com'; $ad = ldap_connect("ldap://$host", $port); if ($ad) { echo "Connected" . "<br/>"; } else { echo ...

1
Q: $.post returns syntax error, unexpected '\'

9903286Okay, so i'm writing some code to post something to PHP script and get back data. However, when i do so i get an "PHP Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR) in /home/multipla/public_html/private/data2.php on line 32" error. I've tried different things to remove this, either ...

0
Q: JSON stringify ignore some values in array

user1480303The Array Look Like This: ["1", "2", R: "aviv", remove: function] 0: "1" 1: "2" R: "Test" length: 2 __proto__: Array[0] When I Use JSON.stringify() for this array i get: ["1","2"] This Because The array length is 2, How Can I Resolve It Please? I need to make ajax post into php script with...

-3
Q: Cart data need to be inserted into Database

VictorI've done the shopping cart part and the data need to be entered into the database. The order detail and sales report need to be used and view by the admin in future <?php ////////////////////////////////////////////////////////////// // SECTION 1.. if user attempt to add somethin...

0
Q: Get Twitter userid from access token only

NoVoThis may be duplicated with other articles but I can't figure out how to do it after reading all of those. I'm working on a backend project in php and we are isolated from the front-end. In the documentation from front end team, they will pass an access token and need the backend to pull userid...

-2
Q: Single entry point into PHP site

user3092616How can I do the following, Route every request to index.php Parse the request uri which will be blah.com/ Resolve whatever it is to a /view/ folder in code where we keep all of our pre-made html snippets (not full pages) and where we'll add custom ones (so we just do a include_once("file") in ...

-1
Q: How does one count the indexes in an array with JavaScript?

dmanexeI have a JSON object through an AJAX request and I want to count the indexes in the array. However, each array within the array is an array itself. I want to set a variable to this number, so I can print it on a UI element, in reference to the number of records left to load. Using jQuery, and I'...

0
Q: Unwanted comma in php output

GerardI'm fighting a PHP thingy. My code outputs correctly buts leaves an unwanted comma at the end. Is there a way to not get (or display) the last comma? Any tip is appreciated. <?php echo mtbxr_val('dog_name'); ?> &nbsp;is&nbsp; <?php $terms = get_the_terms( $post->ID , 'behaviour_options' ); forea...

0
Q: PHP Parse Error Unexpected ';'

CorjavaHeres the code. Sorry if this is a bad question, I'm very new to PHP. for($i = 0; $i < count($searchsingle); $i++){ if($yougender !== $searchsingle[$i] && $youOS = $searchsingle[$i+4] && $youmin >= $searchsingle[$i + 5] && $youmax <= $searchsingle[$i + 6]{ Problem Line ----> $theirn...

0
Q: preg_replace to remove multiple <a href> elements

scooterlordprobably it's something easy for most of you, but I've been strugling to replace all <a href="url"> anything </a> from a string. Can someone help me out with this and give me some pointers with documentations and examples? The php.net doesn't help much, struggling to understand. From what I rea...

0
Q: Confusion over OO approach to class

LukeI place the following at the top of every page on my site. require_once "classes/Session.php"; This class: require_once 'Form.php'; require_once 'Database.php'; class Session{ public $referrer; public $logged_in; public $url; public function __construct(){ $this->startSession(); } p...

0
Q: paypal PAYMENTINFO_0_ACK vs. ACK in digital goods checkout express

davidkomerLong story short, I believe I've implemented the flow correctly, but on the final DoExpressCheckoutPayment I am getting: ACK => SuccessWithWarning L_ERRORCODE0 => 11607 L_SHORTMESSAGE0 => Duplicate Request L_LONGMESSAGE0 => A successful transaction has already been completed for this token I...

0
Q: PHP TinyMCE issue

user3002173I've made script that sends content from tinymce textarea... so html is like this.. <form id="contact-form" action="files/add_article.php" method="post"> <textarea id="tekst" name="tekst_hr"></textarea> <a href="javascript:;" onclick="javascript: document.getElementById('contact-form') ...

0
Q: In Laravel Eloquent, does Model::get() actually fetch the results?

DaveConsider this line: $nodes = Node::orderBy("id", "desc")->take(5)->get() After the execution of the above line, was the Database queried (results were returned)?

-2
Q: SQL query does not insert into table and connection breaks

user3092687This is the SQL query that stores the inputs from the forms into variables and then inserts them into the database table: if ($_SERVER['REQUEST_METHOD'] == "POST") { $username = $_POST['username']; $pass = $_POST['password']; $cpass = $_POST['cpassword']; $fn...

0
Q: Track non registered users

JamalI had already gone through similar questions, but those does not answer my question. I have a weird scenario. In my application (which is fundraising application) there are two types of users. Registered users Non registered users Both types of users can pay with PayPal. I need to restrict b...

0
Q: php inheritance with protected array property is giving me a serious headache

user3092646So I decided to make some classes in PHP so I can dynamically construct a menu bar using <ul>, <li> and <a> tags. Reason why is because I want to reuse this across projects. First the Blob of Code, notice that I put in some debugging info in my code, because I'm actually a .NET developer and I d...

0
Q: Zend Framework 2 : set reason phrase for error 404

Yanick RochonI want my controller to return a 404 response when a model is not found and I want to specify a custom message, not the default "The requested controller was unable to dispatch the request." I have tried specifying the reason in the ViewModel, setting the reasonPhrase from the response object......

0
Q: Display content from a file in color

Johnson SmithI want to display the content from a file to a Textarea but i want the content to be colorful when displayed in the Textarea..Can anyone tell me how to set colors to the content in the file ??

-1
Q: php script to force download of xml file

user1218122I have the following PHP code: <?php header("Content-Type: application/force-download; name=\"test.gpx"); header("Content-type: text/xml"); header("Content-Transfer-Encoding: binary"); header("Content-Disposition: attachment; filename=\"test.gpx"); header("Expires: 0"); header("Cache-Control: n...

0
Q: Full JOIN MySQL Query is returning empty

Will CaseSo here is a MySQL Query: SELECT TestSite . * , LoggedCarts . * FROM TestSite, LoggedCarts WHERE TestSite.email = 'LoggedCarts.Bill-Email' LIMIT 0 , 30 It is returning an empty result set, when it should be returning four results based on the tables below. First Table: LoggedCarts - Column:...

0
Q: javascript parseFloat bug

Rajen ShresthaI am substracting multiple textboxes using javascript. I'm adding the total amount in the textboxes.When amount is first entered it works fine but when i change the amount and save it again there is a bug.The value is pulled from database the second time and is in "00.00" format. The problem is ...

0
Q: Codeigintier Loop Through Multidimensional Array Getting Error Undefined index:

CodinI have a multidimensional Array. Array ( [0] => Array ( [OrderID] => 94 [AccountID] => 1 [UserID] => 1 [OrderStatus] => POSTED [OrderType] => Buy [Subtotal] => 231.91 [ExchangeFee] => 5.00 [OrderFee] => 0.00 [TotalFee] =>...

0
Q: visitor map in betabot

DelphiSo, I was checking out the betabot panel and noticed a really cool feature which I want to track visitor's to my website: It seems to use a graph of some sort, . I looked at: http://jpgraph.net/ but it doesn't seem to be what I want, anyone know what this is called? Sorry to post such a LQ que...

-1
Q: PHP Email not working?

user3086373Trying to get some email functionality working with my file uploader. I've done the below code for the upload / email but it doesn't seem to work :( Any advice? Many thanks! <script> $(function () { $('#fileupload').fileupload({ dataType: 'json', add: function (e, data) {...

0
Q: Resetting column ID's

Jan met de korte AchternaamI currently have a database which looks a lot like the one below: 1 citrus 2 pear 4 apple 5 melon 8 mango The numbers represent a column that hold the row numbers but because rows are often deleted they get messed up quite often. With what MySQL query in PHP could I recount these rows so they ...

0
Q: Attempting to modify a browseCompany.php file, running into a modulemanager.php error

user3092753Attempting to mirror the changes of a browseCompany.php file to a new version of the SJB software. Params are set in the config to allow targeting of a specific user group, however with the browseCompany file unmodified, it still targets all companies. Attempting modification gets me this error...

0
Q: Chech Username(Email) Availability with LiveValidation.Custom Function

user3092756I have a problem with checking for Email Availabilty with the custom function of LiveValidation: It keeps sending back that the Email is already in use even if it isn't. Can someone Please help me out of this ? This is my code until now: JS File: //function to check username availability ...

0
Q: PHP Calendar - Hide Days Previous To Today

user2737457I have a calendar on my website using PHP/HTML and it works fine except that for some reason it is displaying the last 5 days previous to today's date when ideally I want them to be hidden. Here is my PHP & CSS code: .calendarHeader{ text-align: center; text-decoration: underline; co...

0
Q: Downloading A File Located Above public_html

user988129I have a document hosted in a folder above public_html for security reasons - moving the files into the web root is not an option. I'm trying to access them via a readfile() but whatever I download winds up being 0 bytes and an empty file. I think the problem is that the "Content-Length" header ...

0
Q: mysqli_fetch_array php to rertieve value from DB

user1488019Im trying to retrieve a password from a database using mysqli_fetch_array and save it into a variable in order to be used later. but i got no value when i tried to echo it. Thats what i did $select=mysqli_query($con,"select L2 from login where L1='$usrname'"); $fetch=mysqli_fetch_array($selec...

0
Q: PHP end div after X amount of divs and start new one after X divs

user3092730I am trying build an asymmetrical grid with a php loop. I have managed to do this: <?php $arr = array("blue", "yellow", "red", "pink", "green", "cyan", "gold", "orange", "magenta","blue", "yellow", "red", "pink", "green", "cyan", "gold", "orange", "magenta","blue", "yellow", "red", "pink", "gre...

-1
Q: PHP Job Shift detector

Ismail IsmaiilI am trying to make a employee management system where the can get inside and enter which date they have worked, from what time to what time (Ex. 10:00 to 18:00) and stuff like that. So the tricky part is that in my work, there are shifts where the salary changes. Like a morning shift (00:00 to ...

0
Q: I'm having trouble executing a MySQL trigger from php

user3092793For some reason I cannot get this trigger to run in PHP, even though it works in phpMyAdmin CREATE TRIGGER `check_title` BEFORE INSERT ON `customer` FOR EACH ROW BEGIN IF NEW.title NOT IN ('Mr','Miss','Ms','Dr','Mrs')THEN SET @msg := 'Constraint check_title violated'; SIGNAL sqlstate '4500...

0
Q: $.getJSON display the Error: Could not complete the operation due to error c00ce56e in IE

Kettavan Vikki$.getJSON(base_url+"search/ajax_get_results", params, function( data ) { $.each( data, function( key, val ) { alert(key+' : '+val);return false; }); }).error( function( xhr, status, error ) { console.log( error ); }); I used, header('Content-type: text/html; charset=utf-8'...

0
Q: How to get a values from array and display as select list option

Navneil NaickerIn the database for WordPress in one of the plugins the values where entered as array into the fields from the admin. Now I want to get the values from that array and display in the page. I created a function, This works fine. // Pull district from database function get_district(){ global $...

0
Q: How to create a custom macro in laravel 4

melvnberdGood Day how can I use a custom macro in laravel 4? here is my custom macro <?php HTML::macro('flash', function() { $message_status = Session::get('status'); $message = Session::get('message'); $type = Session::get('type'); return ($message_status && $message) ? '<di...

0
Q: DOM XML creating new element instead of appending

BizBinkI'm trying to create a simple applying process that would save the input of the user to an xml document since this is very temporary (and a learning thing). At first it was creating a new element for "applications" when I wanted it to append to that element so I commented it out and tried to get ...

0
Q: CSS Div tag not working

DuckI'm trying to use a div tag to add CSS to a page that I include with include 'login.php'; inside the <div> tag but the css doesn't seem to be working. My ultimate goal is to get the form to overlay the page but right now I just want some sort of styling to work so I can go from there. index.php <

0
Q: pass array in javascript .send function

user3070028This is regarding passing an array to a php page.Is it possible to send an array like this(code below)? if its not possible , what changes should i bring about to my code? function ajax_post(){ var hr = new XMLHttpRequest(); hr.open("POST", "get_numbers.php", true); hr.setRequestHeader...

0
Q: Why does my form reload the page?

Jon LamerI prefer submitting form values with AJAX by hitting "Return" and all my setups, which I did before, are working, but today it stopped working. Here are the the steps, which I have been following for a quite a long time. Include jQuery Setup my form Preventing it form submitting . $(document...

0
Q: Can't get Apple-touch-icon (webclip for bookmarks) to work on Wordpress site

djolivermso I can't for the life of me get the apple-touch-icons working on my Wordpress site. I'm on WP 3.7.1, and I'm also using BPS Security and WP Super Cache (just in case those might have anything to do with it), plus I'm on a Hostgator hatchling shared server (the basic one). I'm trying to implem...

0
Q: PHP - /tmp permission error

IsaiahBasically, I have an .htaccess file, with php_value session.auto_start set to 1. So my session will start in any file. However, now I have a script in my /functions folder, but it gives an error about the permissions of the /tmp, resulting in "Failed to write session data", though it doesn't us...

0
Q: different pointWidths for series in column chart

user2998896I've created a column chart from data I've retrieved from mysql. The data are two series of data. Chart is working. However in the resulting graph I would like to give the series a different pointWidth. PHP script for retrieving the Mysql data: <?php $con = mysql_connect("localhost","xxxx","xx...

-2
Q: PHP Email Not working :(

user3086373Trying to get some email functionality working with my file uploader. I've done the below code for the upload / email but it doesn't seem to work :( Any advice? Many thanks! <script> $(function () { $('#fileupload').fileupload({ dataType: 'json', add: function (e, data) {...

-2
Q: Securing OnClick javascript

user3074428I have a button to reload the page without going to "resend" echo '<input type="button" value="Try Again!" onClick="window.location.href=window.location.href">'; die; is that secure from JS injection?

1
Q: Hidden type input values not being passed in php

BryanI have a contact form that does a very simple captcha system such as "Is the sun hot or cold?" And the user enters hot. I include the original question and answer to the following processing form in type="hidden" fields. The problem is that these input fields are always blank on the following ph...

0
Q: Getting Forbidden error when saving pages with PHP

kcdwayneI built a CMS that uses TinyMCE as its editor. I have PHP protected protect: [ // Protect php code /<\?php.*?\?>/g, /<\?.*?\?>/g, ] but for some reason it throws forbidden on submit (only on pages with PHP.) I'm using an absolute URL in my form action, but i...

0
Q: "show more" button with Ajax

Hossam Ramadani'm using ajax to show new results under an old table, this is my code : <script type="text/javascript"> $(document).ready(function(){ $('#show_more').click(function(){ $('#results_ajax').fadeIn("slow").delay(1000); $.ajax({ url: "../results_ajax/2", type : "POS...

0
Q: How do i add the ability to attach a file on a online mailer in PHP?

ChapTsI've been now searching to find out this for a long time, but couldn't find a exact answer on my specific question. And it goes like this: How do i add the possibility to attach a file to a online emailer I've written in PHP? :) Here is the code: <?php session_start(); if( isset($_POST['subm...

0
Q: PHP, MySQL select all if

Martin Hetfield MaliI have problem with PHP and MySQL please help.. $lokalita_s = $_POST['lokalita_s']; $query = "SELECT nazov, lokalita FROM reality WHERE lokalita = '".$lokalita_s."' ORDER BY id"; ............ But if ($lokalita_s == "nezáleží")... then i want to select every thing from database.. something lik...

0
Q: curl posting data multiple times for curl_setopt

Brad$data = array(); $handle = curl_init($api_url); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); curl_setopt($handle, CURLOPT_POST, true); curl_setopt($handle, CURLOPT_POSTFIELDS, $data); $result=curl_exec($handle); I am too experienced with curl and debugging this code. The data gets posted...

0
Q: PHP-AJAX-JQUERRY Calender With Events Loadded from SQL Database

user2672830i am looking for a PHP event calender, where the events are loaded from Sql Database. Please find the attached link for example, could you please help..? http://www.web-delicious.com/jquery-plugins-demo/wdCalendar/sample.php Thanks Jeena

0
Q: I'm having trouble getting Wordpress' offset parameter to work with Waypoints' infinite scroll

Kyle JosephI want to apply waypoints infinite load to my archive page, which dynamically loads posts by clicking on the sidebar buttons. I'm having trouble keeping track of the number or posts on the page and getting wordpress to output the correct posts I can get waypoint.js to work fairly well with Wordp...

0
Q: MySQL is not starting on Xampp Control Panel

Umair AslamError 1:47:20 AM [mysql] Error: MySQL shutdown unexpectedly. 1:47:20 AM [mysql] This may be due to a blocked port, missing dependencies, 1:47:20 AM [mysql] improper privileges, a crash, or a shutdown by another method. 1:47:20 AM [mysql] Press the Logs button to view error l...

0
Q: Third/fourth WP thumbnail into slider?

user3072221Question regarding sliders in WP theme dev. For WP post attachments into slider on single page I have been using this code: $args = array( 'order' => 'ASC', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post...

0
Q: ZF2 mysql functions in select using TableGateway

daveI'm using ZF2 TableGateway and want to do a select such as where md5(email) = $hash I've tried to do this in the select with ->select(array('md5(email)' => $hash)); but this doesn't work, I get column not found. Any suggestions? Thanks!

0
Q: Magento 1.7.0.0 - Region Manager Extension Successfully Installed but showing nothing there?

Keith HamptonAny reason for seeing this after a successful installation of the 'Region Manager' extension for Magento v1.7.0.0 in the administrative backend? View image here: ( image hosting publicly for screenshot reference for this post ) -> freeimagehosting(dot)net/bcujt <- stackoverflow won't let ...

0
Q: Is there a function for PHP

GregThis is for an experiment I am doing. I am new to PHP and I am creating projects for myself. Is there a function (or some other way) for PHP to scan for specific words that are typed into a text box within a form before they are submitted? If so, can I send my user to a separate page based on wo...

0
Q: How I can develop a registration and login system Jquery mobile

user3060013hello guys at the moment I build a mobile application in jquery mobile my idea is finish the app in jquery mobile and later compile with phone build for IOS and android now my problem is I need build a registration and login pages for the app but dont have much knowledge about this for example I ...

0
Q: What is a more efficient way of writing this mysqli query that retrieves a single row

ianBelow is my query that grabs the next row based on the current row, it works but is kind of bulky, how can I make it a bit more concise? <?php // Credentials $dbhost = "localhost"; $dbname = "***"; $dbuser = "***"; $dbpass = "***"; global $tutorial_db; $tutorial_db...

-5
Q: Using javascript within PHP

Ben McAlindinI'm trying to write a simple website using php and I'd like a javascript confirm pop-up box to appear when the user does something. Depending on the response I'd like to execute a php statement. The javascript does not execute with the below code. There is various other php code before and after ...

-1
Q: How do I display php inside of javascript

RLeisingerI am working with WordPress and I have php that will display text on a page using code like php print_custom_field('Featured_Prop_TransSummary'); What I want to do is use that variable inside some javascript that looks like $(document).ready(function() { $("[rel='popover']").popover({ ...

0
Q: PHP loops through an definitely empty array

CorniWe use a model that always returns arrays. It never returns an object, null, 0, false or something else. Now, I found a fatal error. PHP loops through an empty array. How is that possible? var_dump($arrProduct); //prints array > empty foreach($arrProduct as $Product){ var_dump($Product); //n...

0
Q: move data from one column to another mysql

user3092953I am wanting to move data from one column to another in a MySQL table. Here is my code: $sDate = date("d-m-Y H:i:s"); mysql_query( " UPDATE users SET logintimelast = logintime AND logintime = '$sDate'"); However this does not update either column?

0
Q: I keep getting 23750 as a password with a post submission

user3010455I am completely stumped here. I am creating a simple member system for class and I keep getting "23750" no matter what password variation I type in. First I thought it was a db issue, so I manually entered one and it was fine. Then, i echoed out the password to the next page and I am getting 2...

0
Q: PHP form using check boxes to query the database

user2970595I am trying to query my database in the albums table using a check box list of styles (which is a table column title). I just can't get the data to display, I don't have any errors so I am really lost, I have tried and tried and I am getting no where. Please if anyone have any suggestions chime ...

0
Q: Safari 6.1 multiple file upload does not work while Safari 6.0.5 and other browser works fine

HartsSo I have a file upload site, which I develop using HTML5 chunking ability to upload multiple files. it works fine on Chrome, Firefox, IE (basicly browser with HTML5 capability) as well as Safari, but recently I test it out, Safari 6.0.5 works fine, but on Safari 6.1, If I upload multiple files, ...

0
Q: Can I still use "insert_id" with PHP commit/rollback?

BrianI had a PHP application that automatically committed the insertion whenever I submitted the form. The code I used looked like this: $dbConnection = new mysqli($hostname,$username,$password,$database); $query = "some query here"; $queryResult = $dbConnection->query($query); if($queryResult){ ...

0
Q: Can I store some data permanently in a variable once initialized?

Nick_inawI have a form which has two input field called firstname and lastname with a submit button called submit. The input fields use twitter's typeahead.js with custom event trigger (typeahead:selected) Thus, when the firstname is selected from the dropdown, I have a ajax call in the trigger which po...

0
Q: passing trunc_date postgres timestamp to php date leads to wrong date

AlanChavezI'm using the following SQL query in postgres: SELECT date_trunc('month', s.thedate), r.rank, COUNT(r.rank) FROM serps s LEFT JOIN ranks r ON r.serpid = s.serpid GROUP BY date_trunc('month', s.thedate), s.thedate, r.rank ORDER BY s.thedate ASC; when I run that query d...

0
Q: CakePHP: Session->write() not working

SDPI'm building a very basic auth system for specific pages which require a password to view. I've found several other questions that sound similar, but the only ones with clear solutions involve config settings that don't seem to resolve my problem. For some reason $this->Session->write(...) always...

0
Q: PHP: find key in nested associtive array

Steve CookeI have a method to check whether a key is in a nested associative array: private function checkKeyIsInArray($dataItemName, $array) { foreach ($array as $key=>$value) { if ($key == $dataItemName) return true; if (is_array($value)) { checkKeyIsInArray($dataIte...

0
Q: Zend Framework one module with no mvc structure

MaatataI have been doing research to try and find a way to add Osticket to my application which is created with Zend Framework 1. Unfortunately I can't do that at the moment as the structure is different and mvc framework for osticket is not zend. What I'm trying to achieve here is having a module in m...

0
Q: Disable stripping in PHP Smarty during a block plugin

MartijnWe're using Smarty to generate HTML from PHP. A number of plugins have been added to make life easier. One of these plugins is a block plugin that interprets a custom language and generates HTML code. The custom language has simple statement, using linebreaks to separate the statements. Smarty's...

1
Q: PHP json_encode function returns blank {}

user1527739I am trying to use an AJAX call to fetch some data and return multiple pieces of data to the caller through JSON. It works for certain test things for simple output, but when one of the elements to return is HTML then it does not work. Any thoughts on this? // get_answer() pulls some HTML back...

0
Q: Check if file is being run on server

AceI have a html file which has a link to php file. When i run the html file and click on php link source code of page is being shown as i'm not running on server. Is there a way we can check whether it is running on server and show a message like "Please run it on server" instead of showing source ...

0
Q: How to secure my php?

user2979512when my users post something, they can put iframes and embed. So is it possible to be xss atacked or other? When they send iframe code or embed code, i save it with htmlspecialchars in DB. Is it enough? After that i use htmlspecialchars_decode and stripslashes to show embed or iframe. So, ho...

0
Q: CodeIgniter validation error

user2157179I am trying to use CodeIgniters built in validation to validate my form however whenever I add <?php echo validation_errors(); ?> My html code breaks and nothing beyond this point comes up on the website, and my page source just closes off tags and thats all. Does anyone know why this could b...

-1
Q: Reference php video and image in HTML

robotturtleI'm trying to use an image from php as an img src from PHP as such: <?php $videoEmbed = get_post_meta( get_the_id(), 'ctslider_videoembedcode', true ); $postThumb = the_post_thumbnail(); ?> HTML right after that: <div id="coverimageforplayer"><img class="introvideo" sr...

0
Q: SUM in mysql with customers and excursions

SubiendoGood Night, The objetive is to know the sum of all the excursions in my mysql table. My sql tables are like that. Excursion ID Excursion_Name Excursion_date Excursion_capacity 1 Exc1 date 1 10 2 Exc2 date 1 15 Here date 1 is the excursions ...

-2
Q: Build my own CMS

RachidI've read that it is not a good idea to build your own CMS unless it is for learning purposes. The main reason is because lack of security. Advanced CMSs spend a lot of time testing their CMS to make sure it is secured. My question is, What if I build my own CMS on well known frameworks such Lara...

-1
Q: How to execute parsed javascript

ice_kernelNeed to parse product page that have sizes as dropdown list (select) and he has options actually 1 option but other insert by javasript after downloading the page, have any ideas how to do that?

0
Q: Get this PHP form to send to multiple recipients?

user2109656There are a lot of other posts about this. I have gone through several and tried arrays and inputting emails in the $to field and the like but my form keeps only sending if I specify one email. What am I doing wrong? I'm a PHP noob too. <?php // EVALUATION FORM $your_email ='email1@address.com,...

0
Q: Using PHP plugin or jQuery pluginw with CodeIgniter

NomanCan I use any standard PHP plugin or jQuery plugin (or scripts) in a website built using CodeIgniter, without making any modifications to that plugin (or in its original form)? Please share info, Thanks

0
Q: Echoing a var from a sendmail.php form in a div inside the form page or in a popup window

Serge SfThe idea is to preview (this part works fine) the form somewhere so, if corrections are needed we can go back to the unrefreshed form to make corrections. I have this form: <form action="../../../../sendmail.php" id="Formulaire" method="post" name="Formulaire" onsubmit="return checkform()" targ...

0
Q: dropdown selecting the value but showing its id need to get the name?

user3093049<label style="width:49.8em;">Category: <input type="hidden" name="cat_name" value="cat_name"> <select id="dropdown" name="cat_name"> <?php echo '<option value="" ><---Select---> </option>'; $result = mysql_query('SELECT * from category') or die(mysql_error()); while ($row = mysql_fetch_assoc($res...

0
Q: Symfony2 Wsse authentication

UweI am developing a new Symfony2 project and am trying to set up two things: 1. Custom Authentication Provider 2. A custom User provider I followed the example / tutorial (word by word nearly) given on the Symfony2 documentation pages: http://symfony.com/doc/current/cookbook/security/custom_authe...

 

« first day (295 days earlier)      last day (15 days later) »