« first day (281 days earlier)      last day (29 days later) » 

10:02 PM
0
Q: Use PHP code in .TPL files in Kohana/Smarty Framework

KerryI am unable to write PHP code in .tpl file in either ways I tried <?php echo 'test'; ?> I also tried {PHP} echo 'test'; {/PHP} But both returned error on line 14 "{php}echo &quot;hello!&quot;{/php}" unknown tag "php"

0
Q: highlight selected div when being used as radio button using css

pwnethI was wondering if it was possible to highlight a div with just css when clicked (when div is a label for a radio button) here is my code: <?php foreach ($images as $image) { ?> <input type="radio" name="id" value="<?php echo $image['id']; ?>" id="<?php echo $image['id']; ?>"> <...

0
Q: PHP Script doesn't work. While Condition inside a Loop

bjanka muhametajI hope somebody can help me here. I am just coding a little bit and I am stuck. A tip would be great, which explains to me, where I am wrong. The task is kind of more complex, than what I am doing right now. At the moment, I want the for loop to check every substring of a string. Inside the loop...

0
Q: Setting permission levels in PHP

charlieI have a few pages in PHP, basically one is a login which sets sessions (including user permissions) so in my database i have columns username, password, user, admin, special and it sets them all in sessions on each page i have the following code: if($_SESSION["special"] != 'yes') { echo 'Acce...

0
Q: Php Array Elements Referenced From Another Array Inside a Class

njcInside a class I have 2 associative arrays. I am trying to call elements from one array to be used in another (kind of master) array. I would like to ask whether the following can be done, or can't, or what I'm doing so wrong; Please note, the arrays are examples. class ProductData { priv...

0
Q: Change date format for array to MySQL format using PDO

JamieMy array date format ($fanniemaeDate) that I am passing to the database table column (date) is 11/19/2013 and I am trying to convert it to the MySQL format 2013-11-19 in my PDO prepare statement, however it is giving me an error "SQLSTATE[HY093]: Invalid parameter number: number of bound variable...

0
Q: Shopping cart in db - order lines table or separate cart table?

PatrickI want to store the cart data of my multitenant app in the database. I am wondering if it would be better to have a separate table (a project I work on does it that way but I think they migrated from sessions to that solution) or if I should put everything in the order lines table and have an or...

0
Q: PHP Form IF Issues

user3043669Ok, so I have this in the top part of my code require(__DIR__ . "/lib/db.php"); if (!empty($_POST["action"])) { if ($_POST["action"] == "addCat") { echo "Please wait..."; $sql1 = "INSERT INTO categories (name) VALUES ('".$_POST["name"]."')"; if (my...

0
Q: Chrome app: Reading and writing data from/to a file on a server

DaveI basically want to do an AJAX call to a PHP file on a server. This doesn't seem to work using the XMLHttpRequest. Lets say i have the following files: A PHP file: http://abc.de.fg/folder/data.php and a txt file: http://abc.de.fg/folder/data.txt I want to, from my chrome app, pass some data t...

0
Q: Changing a posts picture depending on the category in Wordpress

dante466I am working in the Reventon theme, and I am in the file post.php. On the blog page, there is an image that is spit out on the left side of every post. I am trying to change that picture depending on what category is assigned to the post. I have tried using this so far: if (is_category('video'...

0
Q: QUnit tests rely on page "onload" JavaScript

BSnapZI have a form that contains a lot of select elements, all of which are populated from a database on page load using AJAX. Code from test_form.js.html: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Testing: 'form.js'</title> <link type="text/css" rel="stylesheet" href="...

0
Q: Innova Editor and jQuery Tabs

user2445610I am working on a web form which uses jquery tabs and multiple innova editors. In each tab there is a text input field, a file upload field, and a textarea which is replaced with an Innova Editor. All of these fields are defined as arrays (example: name="text[]"). I have the form setup to dynamic...

0
Q: doctrine: convert array to doctirne entity

RifatI am looking for a way to convert an array to doctrine Entity. I am using doctrine 2. I have an entity class like: class User { /** * @Id * @Column(type="integer", nullable=false) * @GeneratedValue(strategy="AUTO") */ protected $id; /** * @Column(type="str...

0
Q: MySQL and 000WebHost: Can't connecto to mysql database

M. CoutinhoI created an account on "000webhost" and added a database in MySQL I've been reading in the "phpAdmin" option and the database is created. However when I test the connection I get the following error: Here is the code: <div> <?php // Connect to database server $con=mysqli_connec...

0
Q: Why my variable is undefined inside the function

xoemabIt gives me this error Notice: Undefined variable: newfile and of course it also gives me fwrite() expects parameter 1 to be resource, null given cause of the first error. What I doing wrong? $file = fopen("mycsv.csv", 'r'); $newfile = fopen("myjson.txt", 'w'); function write($text, $tab) { ...

0
Q: Drupal 7 - Couple theming questions

user3043693Hi i got couple questions. 1) I want to set one block template for couple blocks positions (via template.php). 2) Same as first but with page template for couple url names and types (via template.php). 3) I got image field. Instead of showing all pictures on full view, i want to display one i...

1
Q: php form does not save date into database

Legarndarymy problem is that i have a form that was supposed to save information about a comic book into a database, the information it is saving is title, description etc, also it is uploading an image of the comic to my server. right now it does upload the image to the server, but it does not put any i...

0
Q: Variable not working in html (php)

A.RIn this code, I am trying to have my variable show up in the email it sends, for some reason it is not. Is there certain way of displaying a variable in the html? Not sure what I am doing wrong. The variable that won't show is $applicabledocument // Start email send notification ...

0
Q: Error installing php-mysqlnd

Zero WingI've been trying to install phpmysqlnd, but I'm not sure what's going wrong. This is on a CentOS system. I run the commands: yum remove php-mysql yum install php-mysqlnd The first one is a success, but the second errors out, saying: Error: Package: php-mysqlnd-5.3.27-1.el6.x86_64 (CentALT)...

0
Q: php multiple search values in file path

MobileWillI am working on a php site that needs to search a set of files with any combination of search fields. The possible search fields are id, year, building, lastname, firstname, birthdate The folder structure and file names are as such /year/building/file.pdf The filenames contain the data to se...

0
Q: Cakephp change the Form->input output

Ronny vdbI am trying to achieve the output where I have a wrapper div which contains a label and an inner div, and within the inner div I have the form input. My output should look like this: <div class="form-group"> <label>Name:</label> <div class="form-input"> <input type="text" /> </div> </div

0
Q: how to convert $.post form to $.ajax form?

ytsejamI am noob at using jquery and ajax. I need to change the form from $.post to $.ajax . var disqus_config = function() { this.callbacks.onNewComment = [function(comment) { $.post("sendnotification", { comment: comment.id, post: $post->id,author:$author->id}, ...

0
Q: PHP Function, looping

boxWhat i want to achieve: A function that takes a question number and the question (text), prints out the question, then use a loop that works 6 times to print the html out. Skill level: basic The code ive been using is below, the function is below but i dont know how to alter this so i can achie...

0
Q: How to I stop a user from inserting a (spam)url in a text area of a form using php

RiaI have created a form where a user can add a review. Perhaps this is very obvious but how can I avoid a user inserting a url in the text area. Is there a way to check this? I have put in a captcha to check for humans. <form action="" method="POST" name="form"> some other input fields ...

0
Q: php preg_match not giving a result?

Dirk Haasesorry, I'm not good at php, this might be a very obvious mistake. I'm trying to this: $datum = "Samstag, 26.10.2013"; echo("<p>".$datum."</p>"); $regresult = preg_match("(.*)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,4})",$datum, $matches); echo("<p>Result: ".$regresult."</p>"); echo("<p>Error:...

0
Q: PHP Search database and directory structure and match together

charlieI have a table with page_name column which lists all my pages like: directory1/test1.php directory2/test_page.php directory3/sub_dir/page5.php etc.. so it lists the page name and the directory its in how can i match this list with my directory structure and display all the pages that are not ...

0
Q: Unicode characters encoding for a MySQL output

Siddharthan AsokanI'm trying to retrieve data from a table whose collation is 'utf8_general_ci' and the column titled 'app_name' has string like : Plants vs. Zombies™ 2,포코팡 for Kakao,네이버 - Naver,µTorrent® - Torrent App. When I tried to query the table as below: <?php $con = mysql_connect('localhost', 'roo...

0
Q: Laravel 4 OpenID consumer

Javier CadizI'm looking for a good OpenID implementation (only consumer) for the Laravel 4 framework to use with a custom enterprise provider at my work. I a little research i found so far that: The HybridAuth project used by a lot of people is dead ... see here and here The PHP-OpenID project seems old a...

0
Q: PHP File Upload does not work

Djmann1013I am having trouble removing spaces from a file name in php. The file does not upload to the server once the file is submitted. Here is the code: <?php session_start(); mysql_connect('localhost','root','') or die(mysql_error()); mysql_select_db('djmann1013'); if(!isset($_SESSION['username']) &&...

0
Q: CORS request to Wordpress wp-admin/admin-ajax.php returning 0, but can AJAX CORS to normal page

Nick MI'm trying to get an AJAX CORS request to a Wordpress backend. I've set all the headers etc and I'm able to make a successful request to the base URL, and any pages etc, however if I try and access the standard wp-admin/admin-ajax.php URL with an action set, I always get '0' for a response. I'm ...

0
Q: Undefined index: item_cd....Using $this when not in object context

cookHaving trouble in my foreach loop. api layer: $item = new ShoppingListItem($_GET['shopping_list_id'], $_GET['i_sign_in_token'], $_GET['item_cd']); $mod = $item->modify($_GET['i_sign_in_token'], $_GET['quantity'], $_GET['i_oops_coverage']); foreach ($this->ShoppingListItem as $item) { $item->...

0
Q: Updating to the database in php

Bob MarksI am trying to get the code to update some data that has been selected by the user. What is happening is that its updating everything in that column to the value the user has edited it to. For example i have bob, bob1, bob2 and i want to select bob1 to edit. I then edit it so bob1 is now fred1,...

0
Q: Fwrite solution rewrite PHP

user3043737So.. i have problems with this code : $filename = "info.txt"; $tex = $_POST['Name']; $text = $tex . $_POST['Surname']; $fp = fopen ($filename, "w"); if ($fp) { fwrite ($fp, $text); fclose ($fp); It saves ONLY 1 name & surname. after another person submits his info, previous information...

0
Q: PHP Codigniter Function To Count children for binary tree

user2988211 I have built a binary tree using PHP Codigniter but i want function that can 1_Count the left child and right child for every parent. 2_print a message when balanced happened on the tree like if the number of the left children equal to right children send message (balanced ...

0
Q: Select limited number of distinct rows

XeosI have a table in this format: Name | Description | option_id "Apple" | "Sweet fruit" | 3 "Apple" | "Sour fruit" | 4 "Pear" | "Sweet fruit" | 5 "Orange" | "Orange fruit" | 3 "Carrot" | "Vegetable" | 3 I run the query SELECT * FROM table WHERE Description LIKE '%fruit%' and ge...

0
Q: PHP - Returning an SQL table with foreach statement, only returning the value of the first column

Nathan AstonI'm trying to display an SQL table using PHP, by only passing in the table name and then working out the number of rows and columns to display the table correctly. So far I've managed to retrieve the column names, but I'm having trouble getting it to display more than the first column's value, l...

0
Q: Unexpected T_FUNCTION when using 'callback' => function($resp)

Abhisek DasI was writing the script to display the social share counters of various API's and while running the PHP file it gives a Parse error: syntax error, unexpected T_FUNCTION. I know it's an older PHP version issue, as mine is 5.2.17 but I need suggestions to overcome this thing. Here's the code: // ...

0
Q: Summing arrays in PHP?

Richard RodriguezImagine the following two arrays: $array1 = array('dogs' => 3, 'cats' => 5); $array2 = array('dogs' => 2, 'cats' => 7); Is there a native php 5.5 function, or any optimal solution to get the following result? $result = array('dogs' => 5, 'cats' => 12);

0
Q: Warning: oci_execute(): ORA-02290: check constraint

cookNot that familiar with this oracle error. (CUSTOM.CHECK_OOPS_COVERAGE) violated ORA-06512: at "CUSTOM.JAPI_SHOPPING_LIST", line 378 ORA-06512: at line 1 in /var/www/framework/includes/database.php on line 175 Error executing the query: BEGIN :ret := custom.japi_shopping_list.modify_shopping_lis...

0
Q: update query with link to an image

IRONLORDIn my database I have this: <p>Evento de Natal <img alt="" src="http://2.bp.blogspot.com/-kGiurC1ZAYY/TtxsnlfGfOI/AAAAAAAAAZA/A_QbRtqNnJU/s1600/40arvoresnatalmagiagifs.gif" style="float:right; height:199px; width:200px" /></p> When I insert this code in DB works fine. But when I try to update ...

0
Q: pull a table from SQL to create javascript array?

prismspecsI have data like this in a SQL table: ID | Word | Count 1 word1 10 2 word2 5 I'd like to request this data from javascript (or an aJax call I guess?) and have it create an array. I also don't care about the ID#, but just the word and it's 'count.' Then I guess it would be a...

0
Q: Transfering php variables to javascript variables in a php function

JordanWI'm trying to transfer php variables, that I have pulled out of a database, into three different javascript arrays. I use a php function to dynamically create a css dropdown menu, and then use a php loop to transfer the php variables into the javascript arrays. I then try to use a javascript func...

0
Q: Codeigniter passing multiple parameters issue

BoraMy function in users class: public function form($a = false, $b = false, $c= false) { // Something to do } My request uri: ..admin/users/form/1/2/3 I'm getting 404 error: 404 Page Not Found The page you requested was not found. But If i try alphabetical characters like admin/...

0
Q: Try to upload an image using php

Andrei StroescuI got this error log: move_uploaded_file() enter code here [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move '/tmp/phpGmUpFW' to 'images/test@yahsoo.com.jpg' in enter code here[..]send.php on line 32 line32 states: if (move_uploaded_file($_FILES['uploaded_fi...

0
Q: PHP permission levels from database

charlieI have a table with columns: sequence page_name level_user level_support level_accounts level_admin the last 4 columns are the access levels (user, support, accounts and admin) here is the code i am using to check the permissions: $permission_sql="SELECT * from admin_permissions where page_...

0
Q: How to call javascript function in the index of a controller in codeigniter?

PeribackI'm trying to call a javascript function inside my controller to display a warning message in page if a verification I do in the index function of this controller is false. Here is my code: <?php public function index() { $this->load->model('uploads_m'); $this->load->helper('form'); ...

1
Q: Fatal error: Using $this when not in object contex

cookI know I'm not allowed to use this unless it's inside of the class because it points at an object inside of a class. API LAYER: $item = new ShoppingListItem($_GET['shopping_list_id'], $_GET['i_sign_in_token'], $_GET['itm_cd']); $mod = $item->modify($_GET['i_sign_in_token'], $_GET['quantity'], $...

-1
Q: PHP Uploader, can't upload to specified path, getting error.

user3043827I am fairy new with PHP coding, but I am trying to do something that is quite simple. When someone on my site uploads a picture, the image will get renamed to random numbers and moved to my directory 'uploads/' In my script below, Everything has been working up until // Upload the file to your...

0
Q: Pull from MySQL and Rotate using AJAX ever 30 seconds

user3043820I am having that hardest time learning AJAX. I found a tutorial I have been trying to copy but it is not working. The link to it is: How do I make my random MySQL query automatically refresh every 5 seconds I want to pull from the same MySQL table 3 columns (Same row) and display them for 30 sec...

0
Q: File uploading using CodeIgniter is failing

Cata VisanTitle says is all. Form in view: <tr> <form action="<?=base_url()?>index.php/admin/product_add" method="post" enctype="multipart/form-data"> <td><input type="text" name="pid"></td> <td><input type="text" name="name"></td> <td><input type="file" na...

0
Q: Jquery Cookie set input value on a form

Michael FalcigliaI am the learning Jquery Cookie plugin. I have been able to save a cookie and have verified it. But I am having a little trouble taking that cookie and setting an input value on a form with it This is what I am trying to use to retrieve it and set the input value, can anyone see what I am doing ...

0
Q: Domain specific email validation

user3043801I am trying to code a registration form where I am validating the email used to sign up. In a nutshell, I want to ensure that the email ID used to register, is a company domain, and not something like gmail or yahoo. I have the following code to check IF an email is a part of the given domain, ...

0
Q: mysql and php change single data for specific id

Jeffrey van ZwamThis is kind of complex to me, so I hope someone can help me out. I have a table that shows messages which are stored in a database. These messages works like a commentbox. The database that holds these messages contains the following tables: id, name, message, urlUserOne, urlUserTwo, urlUserTh...

0
Q: Combining tables while searching for one of the elements

Jochem KuijpersI asked this question yesterday: MySQL how do I combine these tables? I want to search blogposts by their tags, how do I do this? Again, my tables are: blog_posts int id (auto increment) varchar(255) title text content blog_tags int id (auto increment) varchar(63) name blog_postta...

 
11:51 PM
0
Q: Inconsistent link appearance when posting to Tumblr from Facebook

user3043809wondering if anyone can help - I've recently set up a Tumblr, and I'm afraid I know fairly little about the technical side of the site in general, let alone the Open Graph tags for Facebook. Having researched a bit online (incl. various posts on this site), I've managed to set my preferred ima...

 

« first day (281 days earlier)      last day (29 days later) »