52,566 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for Dani

I just thought I'd share this because it took me a bit of time to figure out tonight. When members post content with MS Word quotes, etc., and they look funky on our UTF-8 websites, it's because those characters need to be converted to UTF-8. This bit of code worked …

Web Development php
Member Avatar for gabrielcastillo
2
484
Member Avatar for happygeek

Google has been quick to blacklist domains implicated, most often unwittingly, in the distribution of what has become known as the SoakSoak malware campaign courtesy of soaksoak.ru being the first domain in the redirection path it used. With 11,000 domains blocked over the weekend, you might be forgiven for thinking …

2
653
Member Avatar for cereal

When using emails as usernames you want them to be unique over your table, but this can be a problem if you consider a GMail account, because of their [username](https://support.google.com/mail/answer/12096?hl=en) [policy](https://support.google.com/mail/answer/10313?hl=en). They allow: * dots * digits * letters * plus addressing text by using the `+` sign, i.e. `orange+juice@gmail.com` …

Web Development email php seo
Member Avatar for cereal
2
663
Member Avatar for diafol

Hi all. Been playing with some autoloading but couldn't get it to work. I'm trying to implement the PSR-4 (project scope) approach, but documentation is sketchy and I'm a bit lost as to the issue. I've read the PHP-Fig docs: http://www.php-fig.org/psr/psr-4/ and an trying to implement a script from the …

Web Development github php
Member Avatar for diafol
2
718
Member Avatar for matrixdevuk

Hello! So, I see you need help... or maybe you just fancy a nice little read. Either way, this is here for a reason. When you post code on DaniWeb, it can be frustrating waiting for a reply (trust me, I've been there!) — so... here are some tips that …

Web Development php
Member Avatar for matrixdevuk
2
304
Member Avatar for happygeek

A report from Hold Security claims that one of the biggest ever online heists has been committed by a Russian crime gang. It would appear that the data theft includes, wait for it, no less than 1.2 billion (yes billion) username and passwords along with around half a billion email …

Web Development cybersecurity social-media sql
Member Avatar for F-3000
2
352
Member Avatar for veedeoo

Hello everyone, **!WARNING! this function should only be use, WHEN ffmpeg PHP CANNOT be installed in the server.** I just got some free time from tedious and hectic school schedules. About two months ago, I saw a question about "how to get the duration of a given video file?". Of …

Web Development php video
Member Avatar for ifile168
2
17K
Member Avatar for Dani

Our up/down voting buttons don't do anything on iOS devices (iPhone, iPad). Confirmation that they work fine on Blackberry and other mobile devices. Additionally, they work fine on all desktop browsers, including Safari. HTML code looks like this: <div class="vote-arrow downvote" data-vote="-1">&nbsp;</div> <div class="vote" title="Vote on posts with a comment …

Web Development html-css ios ipad iphone javascript
Member Avatar for JorgeM
2
359
Member Avatar for Poonam Jadav

hello i m a student & new to php i want to pass id from one page to another page using get & post method but the id can not be passed it shoes the variable in URL instead of value please can any one help me Here is the …

Web Development first-post php
Member Avatar for pzuurveen
2
43K
Member Avatar for stokie-rich

Hi guys hope your all well, I want to put a quiz into my website that I'm doing. I've found some code for a Multiple Choice-True False Quiz Here is the code, (yes I know its long and there are some reputation in it) You have to add questions by …

Web Development mysql php sql
Member Avatar for mattster
2
3K
Member Avatar for veedeoo

Hello Everyone, I wrote this script way back in 2008 as Version1. However, I was forced to forget about this, because it was criticized by many developers with BS, MS, and "Seasoned PHP Developer" under their names. During those days, I couldn't stand up for my own reasons, because I …

Web Development open-source php
Member Avatar for veedeoo
2
2K
Member Avatar for pritaeas

A while ago I explained how you could tag articles (see [this thread](http://www.daniweb.com/web-development/php/threads/387961/php-code-to-show-related-posts-on-a-blog)). Now you get a full working example. This code and the SQL script is also available on GitHub. The attached MySQL dump needs to be imported into your database, and you must update the credentials in the …

Web Development github mysql php
Member Avatar for aufche
2
910
Member Avatar for RikTelner

Hey, how to make really vertical menu? Like this one: http://media.smashingmagazine.com/images/navigation-menus/vert.gif I was "reading" article with menu ideas. I found this one. It had link, but it's broken (showing commercial page). Or server hates my IP.

Web Development
Member Avatar for RikTelner
2
159
Member Avatar for Paladine

This is sample code for a ASP.Net Login page (using Visual Basic.Net code behind) with OleDB connection to an Access Database using ADO.Net. The datebase used is the Access Northwind Database. With the connection string being placed in the [i]web.config[/i] file. [b]1. [u][i]Web Config[/i][/u] File code:[/b] [code] <?xml version="1.0" encoding="utf-8" …

Member Avatar for Anita_1
2
19K
Member Avatar for diafol

While extending a mysqli class, I ran into an issue with binding parameters. I've read that db names and table names should not be used as parameters, but while I was pondering this statement... SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$dbname' I thought, as the db name is a …

Web Development mysql php
Member Avatar for diafol
2
293
Member Avatar for Robert Rusu

First things first, the story about this article. Recently I've created an Wordpress Plugin [WordPress - WP - Keywords To Tooltip | CodeCanyon](http://codecanyon.net/item/wp-keywords-to-tooltip/6513598) After a few days, somebody asked me if it's working with Wordpress Multi Site, initially scared, I didn't expect it to be so easy, I've achieved the …

Web Development php wordpress
Member Avatar for Robert Rusu
2
430
Member Avatar for Dani

# The nature of this tutorial ... This tutorial is designed to walk you through DaniWeb's implicit (clientside) OAuth flow. This is not designed to be an introductory tutorial to OAuth, and we will expect that you are already familiar with the nature of OAuth and/or have read our tutorial …

Web Development api daniweb-api javascript
2
1K
Member Avatar for Gaetane

This started out as `I love PHP traits! I'm going to use them everywhere! ^_^` and now it has turned into a `Thought Exercise / Learning Experience >_<`. Consider the following example: trait TheErrorOfYourWays{ public function booboo(){ echo 'You had a booboo :('; } } trait SpectacularStuff1 { use TheErrorOfYourWays; …

Web Development php
Member Avatar for Gaetane
2
2K
Member Avatar for diafol

Having just found 'traits' - see http://www.daniweb.com/web-development/php/threads/468928/php-trait-method-conflicts-trait-inheritance#post2043565 I was wondering whether they could be used to share a DB connection object across disparate classes, or would the old singleton or dependency injection methods still be the way to go? I'd value any views on this.

Web Development php
Member Avatar for diafol
2
720
Member Avatar for cereal

Hello, I've an array with different type of values: int, null, strings, arrays. I'm trying to remove nulls and empty strings, but I want to save ints, even when it equals to zero, so I tried with `array_filter()`, by default it will remove `0`, `''` and `null`, but by applying …

Web Development php
Member Avatar for cereal
2
435
Member Avatar for Sp!ke

This little snippet will teach you all about arrays and arrays of arrays, and so on and so forth.

Web Development php
Member Avatar for LastMitch
2
231
Member Avatar for <M/>

I found a resource that can help some people learn programming a bit better. The resources are provided by Harvard (presented by their students) and I watch a couple of their videos and they were really good. So I thought I should share it with you guys. Here is the …

Web Development
Member Avatar for pritaeas
2
111
Member Avatar for 72dpi

Case switching is a neat way to make your site a bit more dynamic. it gives you the ability to show blocks of information "on the fly". By attaching the variable name "Content" to our link, we pass that condition in the query string. Note that on the last link, …

Web Development php
Member Avatar for michel.cote
2
1K
Member Avatar for pritaeas

Here's my base class and class for the unauthenticated DaniWeb API calls. Not every method has all features implemented yet, and it's not been fully tested either. Here's how to start using it: include 'DwApiBase.class.php'; include 'DwApiOpen.class.php'; $dwapi = new DwApiOpen(); $result = $dwapi->GetMemberActivityPoints(94719); $result = $dwapi->GetMemberEndorsements(94719); $result = $dwapi->GetMemberReputationComments(94719); …

Web Development api daniweb-api php
Member Avatar for pritaeas
2
435
Member Avatar for diafol

OK, as promised, here's an updated 'quick(!) and dirty' class for retrieving and setting data via the Daniweb API. It allows the extraction of data based around: # DATA RETRIEVAL & SETTING # ## non-OAuth ## * forums * articles * posts * members * activity points * endorsements * …

Web Development api daniweb-api php xml
Member Avatar for LastMitch
2
563
Member Avatar for asifalizaman

what is the difference b/t PHP and ASP.net php is the server side scripting language and ASP.net is i think same as php but specific to Microsoft .am i right kindly explain differenc

Web Development asp asp.net php
Member Avatar for jkon
2
250
Member Avatar for asifalizaman

hi!guys Today i want to learn from you.. where to start PHP and what tool is the best for me .i am a beginer and i want to expert in PHP so what you suggest me Thanks for reading

Web Development php
Member Avatar for diafol
2
293
Member Avatar for asifalizaman

hi!guys i think you all will be fine,..........Today i want to know from you what is the difference b/t PHP and XML also which is best ,which language i start learing first and what's relation are among b/t two languages..My poin of view is PHP is hypertext preprocessing language used …

Web Development php xml
Member Avatar for asifalizaman
2
537
Member Avatar for pritaeas

Wasn't sure yet whether to post this publicly. I've adjusted the PHP code snippet for the OAuth. Curl allows you to trap a redirect and this snippet just shows how to do that for the token. The regex searches for the redirect url in the returned header, it can be …

Web Development api daniweb-api php regex session
Member Avatar for pritaeas
2
558
Member Avatar for ipster

#Web app state management# The current state of the user interface determines which application actions are enabled and thus which html elements are enabled for the user to invoke them. Classes are used in the html to indicate elements that need to be managed. Then jQuery is used to configure …

Member Avatar for LastMitch
2
359
Member Avatar for cereal

> There is a vulnerability in certain CGI-based setups (Apache+mod_php and nginx+php-fpm are not affected) that has gone unnoticed for at least 8 years... read more: http://www.php.net/archive/2012.php#id2012-05-03-1

Web Development apache php
Member Avatar for LastMitch
2
525
Member Avatar for code_rum

Here is my code: $(document).ready(function () { $(".submit-text").click(function () { var startdate = $("#startdate").val(); /*This line returns mm/dd/yyyy */ var starttime = $("#starttime").val(); /*This line retruns hr:min AM/PM */ var dtstart = new Date("startdate" + starttime); alert(dtstart); }); }); ****On alert it displays invalid date... but if I use.. var …

Web Development javascript javascript-jquery
Member Avatar for code_rum
2
177
Member Avatar for pritaeas

Below is a documented code example showing how to use the SQLite3 class to connect and query your database (and check for errors). IMHO using PDO is a better alternative, as this extension uses mixed technology in a non-standard way (objects, arrays and exceptions). If there are any questions let …

Web Development php sqlite
2
4K
Member Avatar for pritaeas

Below is a documented code example showing how to use the SQLite functions to connect and query your database (and check for errors). Please note that using the SQLite extension is NOT RECOMMENDED. This extension is no longer available in PHP 5.4.0. If you want your scripts to be future …

Web Development php sqlite
2
589
Member Avatar for pritaeas

This demo will show a PHP script using a Smarty template. It assumes basic installation. In the folder where you copy the script, there should be a smarty folder containing the Smarty files. You should create a writable `cache` and `templates_c` folder, and a folder called `templates` where the `.tpl` …

Web Development php ui-ux
Member Avatar for pritaeas
2
532
Member Avatar for jeffcogswell

IE9 is on the horizon, and there has been plenty said about it. But what about its web development aspects? In this article I look at its web developer tools, and decide whether I'll start using it in my own web development. Like most web developers, I abandoned IE several …

Member Avatar for fiascolabs
2
1K
Member Avatar for pritaeas

Below is a documented code example showing how to use the [PDO](http://php.net/pdo) classes/objects to connect and query your database (and check for errors). If there are any questions, or you want to see different features, let me know. UPDATE: I've encountered a problem with PDO and bit fields (MySQL). If …

Web Development php
Member Avatar for sammry
2
3K
Member Avatar for rotten69

Hi everyone, I'm sure there are people who are using highCharts framework. I'm having a trouble passing the values to jquery code from PHP json. Your help is so appreciated. This is my php section <?php header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 01 Jan 2013 00:00:00 GMT'); // The JSON standard …

Web Development javascript json php
Member Avatar for rotten69
2
419
Member Avatar for LastMitch

Hi I'm trying to figure out how to `<input> $radius` and `echo $pi` without using a **DB**. This is a simple example how this calculate `$pi` which you can run and see how it works: <?php $pi = "3.1415927"; $radius = 8; echo $pi * ($radius * $radius); ?> The …

Web Development php
Member Avatar for LastMitch
2
197
Member Avatar for Troy III

# This is a simple HTML String Sanitizing tool. # ## It allows a highly rich,- but safe - html content input to be published on your pages. ## **The script code is very light and to some degree customizable.** * This function takes care of blacklisted tags, which are …

Web Development html-css javascript
Member Avatar for Troy III
2
274
Member Avatar for LastMitch

Hi I been doing some research on **PHP Frameworks**. I want to know what other Daniweb members used as **PHP Frameworks**? I'm still new to understand how it works but would like to know which one will suit my skills, so I can built on ... to move forward to …

Web Development php
Member Avatar for LastMitch
2
163
Member Avatar for somedude3488

I recently applied for a PHP programming job and they required me to do a coding challenge. One of the challenges involved simulating the card game war which I found intriguing. I "over-engineered" it as they requested, but I still don't think it was good enough for them. Is there …

Web Development gaming php
Member Avatar for masterdeveloper
2
680
Member Avatar for LastMitch

Hi I want to find out is there a way to check syntax errors on PHP. I went to this site http://php.net/manual/en/function.php-check-syntax.php but I didn't quite understand the example in there. Is there a software that I can check the errors. I used EasyPHP, WAMPP. I appreciate any links or …

Web Development php
Member Avatar for LastMitch
2
583
Member Avatar for hollystyles

The aim of this tutorial is to save burgeoning self taught developers some of the early pitfalls that lurk on the road to programming enlightenment. It will attempt to do this by distilling the last 50 years of software engineering philosophy into a relatively short single tutorial, applying the concepts …

Member Avatar for buck1107
2
4K
Member Avatar for rotten69

Hey everyone, I tried testing this code if it is true or not. But,apparently, it is indeed true. So, it is not like referencing an element in array and changing its value. Can someone explain it why this is exceptional with numbers, please? var a = 3.14; // Declare and …

Web Development javascript
Member Avatar for rotten69
2
234
Member Avatar for Squidge

I have been looking over current frameworks available and I am looking to settle on CodeIgnitor. What framework and IDE do you use? What are the plus sides, limitations of your choice?

Web Development ide php
Member Avatar for Squidge
2
142
Member Avatar for Xephis

Hi I am trying to run a query where the user enters a number, and it searches the table for it and displays any results within 50 of that search. e.g. user searches for 500, anything from 450-550 would be shown. I have the code for showing an exact result …

Web Development mysql php
2
67
Member Avatar for LastMitch

I'm new to this forum but I do read posts as a non-member and I learn a lot from reading other posts from other member. I'm having problem understand how to write the code correctly. I can't seen to figure out the international shipping cost but for domestic it works. …

Web Development html-css php session
Member Avatar for LastMitch
2
200
Member Avatar for simplypixie

I just thought I would re-iterate something that I have mentioned a few times in my replies to threads on here in that if your code isn't working, one of the first things to do is actually test your query in the database (i.e. through phpMyAdmin). The reason I am …

Web Development mysql php sql
Member Avatar for rotten69
2
148
Member Avatar for |-|x

I originally posted this over on the [URL="http://wordpress.org/support/topic/incorrect-page-content-passed-to-plugin-in-firefox"]WordPress forums[/URL], and got no responses. Eventually I figured out what the problem was and fixed it, but thought I'd repost here in case anyone else is experiencing similar issues (I couldn't find any related articles in my initial search on the symptoms.) …

Web Development php session web-browser wordpress
Member Avatar for cereal
2
206

The End.