743 Posted Topics

Member Avatar for azegurb

[QUOTE=azegurb;1227829]hi there, I have one question here is my code taken from the internet which is about the static function but i dont exactly understand for what reason we use here static function and what does mean self and code which is below can anyone explain it to me .... …

Member Avatar for digital-ether
0
138
Member Avatar for benk1

[QUOTE=benk1;1227814]Hi Guys I wrote a little web app to integrate with an SQLite database. When the database is on a local PC, there is no problem connecting to it as in: [CODE]$connect = new PDO("sqlite:\path\to\database.db");[/CODE] Now I've been asked if I can adapt it to connect to a linux device …

Member Avatar for digital-ether
0
854
Member Avatar for bmcconkie

If you'll be reading large files, it is better to use fopen() and fwrite() equivalents, just like how the `cat file1.txt >> file2.txt` is actually reading/writing streams instead of buffering the whole file to memory. Example: appends file1.txt to file2.txt [CODE] if ($fp = fopen('file2.txt', 'a')) { if ($fp2 = …

Member Avatar for digital-ether
0
111
Member Avatar for Davife

Parsing incoming mail is not a simple task. I wrote a full mime mail parser a while ago: [url]http://www.bucabay.com/web-development/a-php-mime-mail-parser-using-mailparse-extension/[/url] I also wrote up how to parse incoming mime mail messages. [url]http://www.bucabay.com/web-development/incoming-mail-php-mime-mail-parser/[/url] Getting the email messages has two parts. First you have to set up your server to accept incoming mail. …

Member Avatar for digital-ether
0
117
Member Avatar for kumarbhc85

[QUOTE=kumarbhc85;672861]hi, i try to write a word doc at runtime through bookmark and it work in local system. But "COM" was not working in Linux server.. pls give me some other code to do this operation. i search in google but i cant find the exact code.. Thanks Kumar.[/QUOTE] COM …

Member Avatar for hphiri
0
528
Member Avatar for mahe4us

Yes, of course. Take a look at the PHP stream (socket) functions: [url]http://www.php.net/stream[/url] If you look at the page about at the example: [B]Making a POST request to an https server[/B], you'll notice it is a socket connection to the port 443 over SSL. Stream functions allow any protocol however. …

Member Avatar for BzzBee
0
183
Member Avatar for michael123

I dont know why you would want to wrap str_replace with a class and function. Its works ok by itself... ;)

Member Avatar for bhebs_quines
0
4K
Member Avatar for chunalt787

Multiple queries are not supported by mysql_query(). see: [url]http://php.net/manual/en/function.mysql-query.php[/url] Also make sure to quote the string you send as well as escape them with mysql_real_escape_string(). For the integers use intval() on them. This prevents sql injection, and ensures the values do cause an error if they contain special characters.

Member Avatar for chunalt787
0
123
Member Avatar for bjeffries

Parse errors happen when the formatting (syntax) of your code incorrect. Because a parse error is only detected once an unexpected piece of code is reached by the PHP intepreter, it often gives you the wrong line number of the error. The error in this case is with this portion: …

Member Avatar for bjeffries
0
349
Member Avatar for SKANK!!!!!

I'd suggest putting together a relative URL, as that ensures the domain is the same. The full path and query is available in: [CODE]$_SERVER['QUERY_STRING'];[/CODE] However, you don't want to just echo that into HTML (as in a meta refresh), as it would open an XSS vulnerability. I I believe you …

Member Avatar for SKANK!!!!!
0
196
Member Avatar for Midnite003

[QUOTE=Midnite003;1186284]I have thsi script and I am trying to pass the variables to a form ... and have it email them but for some reason its not working ... can anyone offer a reason why it might not be or what I might do to fix it ? This is …

Member Avatar for digital-ether
0
175
Member Avatar for niths

[QUOTE=niths;1186399][CODE]$sql2="select allocatedmemory from projects where projectname='$projectassign'"; mysql_error(); $d=mysql_query($sql2); $data1=mysql_result($d,0); echo '$data1';[/CODE][/QUOTE] [CODE]echo '$data1'; [/CODE] should be: [CODE]echo $data1;[/CODE]

Member Avatar for prem2
0
76
Member Avatar for g_j_evans

[QUOTE=g_j_evans;1185940]Does anyone know of an AJAX script with this kind of drag 'n' drop functionality: [url]http://bit.ly/atE420[/url] The software in the video is called CODA (a Mac application for developers). I was wondering if something like this has been done in AJAX. Thanks[/QUOTE] You can build such functionality with popular JavaScript …

Member Avatar for digital-ether
0
127
Member Avatar for cwarn23

[QUOTE=cwarn23;1129374]I thought I would let you's php gurus know that I am starting to come close to cracking the Sha1 algorithm. And surprisingly it is an easy one to crack. So I would recommend switching to something like the whirlpool algorithm.[/QUOTE] Are you serious? Are you willing to share with …

Member Avatar for cwarn23
0
653
Member Avatar for digital-ether

I have a page that is under SSL. However, in IE6, I get a notification: "This page contains both secure and non-secure items" etc. I've looked at all the HTTP requests for that page in both Firebug and Wireshark, and none of it seems to be sent over plain HTTP, …

Member Avatar for digital-ether
0
204
Member Avatar for forzadraco

[QUOTE=forzadraco;654754]i have a problem: i want redirect everything page in url: ex: [url]http://dracotech.biz[/url] to [url]http://www.dracotech.biz[/url] . want to add www. in everything request from user.. maybe with mode rewrite in apache but i didn't find way how to do it..[/QUOTE] [CODE]RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301[/CODE]

Member Avatar for rsleventhal
0
173
Member Avatar for Barefootsanders

[QUOTE=Barefootsanders;332033]Ahh thank you. That fixed it up. But now I have another error. Its in my file that creates a PHP session. It gives me this error: [B]Parse error[/B]: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [B]session.php[/B] on line [B]59 [/B]And line 59 looks like this: …

Member Avatar for Barefootsanders
0
1K
Member Avatar for sam023

[QUOTE=sam023;1129600]ya that function convert string into Hexadecimal..!! and work perfectly with english characters but not with non english char. wht should i do when string is non english characters like Arabic..?? like مرحبا how can i convert Arabic string into hexadecimal..?? and how can i insert Arabic string into database..??[/QUOTE] …

Member Avatar for sam023
0
1K
Member Avatar for sheru2302

How is it not working? Are you getting errors, if so what are they? Try turning on error reporting to max, and set display errors to true. ie: [CODE]error_reporting(E_ALL); ini_set('display_errors', 1);[/CODE]

Member Avatar for sheru2302
0
709
Member Avatar for ayesha789

Use regular expression: eg: [CODE]$name = 'S-KHI-1233'; $name = preg_replace("/[^0-9]/", '', $name);[/CODE]

Member Avatar for ayesha789
0
170
Member Avatar for sam023

See PHP's multi byte functions: [url]http://www.php.net/manual/en/ref.mbstring.php[/url]

Member Avatar for digital-ether
0
139
Member Avatar for sarithak

Hello sarithak, The problem with the URL encoding is that you have escape() and encodeURI() applied to the same string. So the string is double URL encoded. Infact you should use encodeURIComponent() and not encodeURI() to encode url parameters. [INDENT]URL encoding is a way to encode URL parameters so that …

Member Avatar for digital-ether
0
89
Member Avatar for Stefano Mtangoo

I'd first decide how I want it designed. For example, Joomla uses Observer pattern for authentication while Pear Auth uses inheritance. In Pear only one authentication source can be used at a time, since PHP does not support multiple inheritance. In Joomla multiple authentication source can be used since they …

Member Avatar for Stefano Mtangoo
0
602
Member Avatar for nishanthaMe

[QUOTE=nishanthaMe;501244]Hey guys; can anyone suggest me to develop a simple RSS reader with php.[/QUOTE] You can also use a RSS parser such as Magpie or Pear RSS. [url]http://magpierss.sourceforge.net/[/url] [url]http://pear.php.net/package/XML_RSS[/url]

Member Avatar for pavithraCS
0
118
Member Avatar for SKANK!!!!!

[QUOTE=SKANK!!!!!;1086910]ok so u only loc the table ur using? how is this done? thanks that makes more sense to me now[/QUOTE] See the examples on the page Atli linked: eg: [CODE]LOCK TABLES t1 READ; [/CODE]

Member Avatar for SKANK!!!!!
0
174
Member Avatar for mandysaini

[QUOTE=mandysaini;1071087]Hi, I am a student in college and am using the college internet facility although the computer is mine. I want to host a Blog and I need to know if the PHP is enabled. How do I find out?[/QUOTE] Do you want to host the blog on your computer? …

Member Avatar for digital-ether
0
143
Member Avatar for treyk4

You're probably after the functionality in ORMs. [url]http://en.wikipedia.org/wiki/Object-relational_mapping[/url] The most popular for PHP being: [url]http://www.doctrine-project.org/[/url]

Member Avatar for digital-ether
0
159
Member Avatar for jonow

Having PHP handle static files, such as JS and CSS and gzipping them on the fly is inefficient. A better approach is to have PHP write a gzipped version of the static file to the filesystem. You can check on each request if the file has changed, and then re-write …

Member Avatar for jonow
0
283
Member Avatar for balam

A good start is to turn on error reporting: [CODE=php]error_reporting(E_ALL); ini_set('display_errors', '1');[/CODE] Show errors in your mysql query: [CODE=php]$result = mysql_query('SELECT * WHERE 1=1'); if (!$result) { die('Invalid query: ' . mysql_error()); }[/CODE]

Member Avatar for dasatti
0
96
Member Avatar for levsha

This article explains the process: [url]http://www.bucabay.com/web-development/incoming-mail-php-mime-mail-parser/[/url] If you cannot setup your PHP script to handle incoming email, the other option is to pull mail from the mailbox when you need it. Such as with POP or IMAP etc. You do not need these built into PHP, pure PHP can do …

Member Avatar for Simply T
0
493
Member Avatar for ragnarok511

You can POST raw data to the server if you needed. This would be done by setting the correct HTTP headers: [url]http://www.w3.org/TR/2009/WD-XMLHttpRequest-20091119/#the-setrequestheader-method[/url] Example: send XML data [CODE=js]var client = new XMLHttpRequest(); client.onreadystatechange = function() { // do your stuff if (this.readyState == 4) alert('sent'); }; client.open('POST', 'page.php', true); // this …

Member Avatar for digital-ether
0
2K
Member Avatar for Xamas

Try benchmarking the xml parsing process: You can simply use: [CODE]$start = microtime(true); // do a few $lapse = microtime(true)-$start;[/CODE] and: [CODE]$mem = memory_get_usage(true);[/CODE] To get the memory used and exec time. Stop after just a few loops so you can analyze. How well does XMLReader manage memory? The other …

Member Avatar for digital-ether
0
439
Member Avatar for nickora

[QUOTE=nickora;1059284]has anyone installed wordpress on a joomla website and tried to integrate users? Im weighing up the pro's and cons of doing this to a couple of sites, I dont need the users to be integrated just yet, but it is something I think might come up in the future …

Member Avatar for digital-ether
0
151
Member Avatar for findyaseek

PHP5+, you can also use the stream functions. [url]http://www.php.net/manual/en/book.stream.php[/url] [url]http://www.php.net/manual/en/function.stream-socket-client.php[/url] or the similar fsockopen() in PHP4: [url]http://www.php.net/fsockopen[/url] With both of these you will create the raw HTTP request to send over TCP. However, if you need something more abstracted like cURL, you can use fopen(), with stream_context_create() in PHP5: [url]http://www.php.net/manual/en/function.fopen.php[/url] …

Member Avatar for digital-ether
0
328
Member Avatar for drjay1627

[QUOTE=drjay1627;1052879]My friend and I are working on an Internet bot. We want to make a bot that given a website, would index into a table. Example -- Given the website: [url]www.daniweb.com[/url] Add to table: [url]www.daniweb.com/c++[/url] [url]www.daniweb.com/c++/forum[/url] [url]www.daniweb.com/java[/url] etc... Any suggestion on how to do this?[/QUOTE] To explain how this is …

Member Avatar for digital-ether
0
306
Member Avatar for hno

[QUOTE=hno;1051222]HI i know php/mysql and javascript well and I've made some web site . now , I want to make a online game web site that it has two type of games . One type are simple games like BACKGAMMON or chess another type are multiplay games . I have …

Member Avatar for digital-ether
0
196
Member Avatar for shishtawitch

[QUOTE=shishtawitch;1053192]hi, how can i make a link attache ment system with php, culr / ajax one like in facebook..........!! i.e by typing a link fetching meta, title and images from that link...!! thanks in advance.........!![/QUOTE] Since the links are external domains, you'll need to have PHP act as a proxy. …

Member Avatar for digital-ether
0
108
Member Avatar for mexabet

[QUOTE=mexabet;1047817]Please, I need a code that is capable of preventing SEOQuake from loading on my websites, even if a user has installed the plug-in. For example, Google, Yahoo and Bing implements such feature. I just don't want it to load whenever anybody visits my sites.[/QUOTE] You cannot stop a firefox …

Member Avatar for mexabet
0
155
Member Avatar for codewalkz

[QUOTE=codewalkz;1043592]Anyone who knows how to apply this in php scripting? the scripts in this site can be xecuted in mysql console but I can't get it working in php script in the website im studying. I want to create a tree like this: [URL="http://sitepointstatic.com/graphics/sitepoint_numbering.gif"]http://sitepointstatic.com/graphics/sitepoint_numbering.gif[/URL][/QUOTE] The examples at [url]http://www.sitepoint.com/print/1105/[/url] should do...

Member Avatar for codewalkz
0
451
Member Avatar for pcs123

There manual page on the readfile() function has some really good information and examples on sending a HTTP response with different headers. For example, if you want to support resuming downloads. [url]http://php.net/manual/en/function.readfile.php[/url] A good thing to note for having PHP send your files is that you should use flush() if …

Member Avatar for digital-ether
0
1K
Member Avatar for sam023

[QUOTE=sam023;1042803][code=php] include_once('session.php'); include_once('config.php'); $userid = $_SESSION['userid'] ; $uname = $_GET['uname']; $query= "call sp_active('$uname','$userid',@u_active)"; $result = mysql_query($query) or die('query_error'.''.mysql_error()); if($result) { header('location:vagent.php'); } [/code] simple php code.. but still throwing Cannot modify header information - headers already sent by i have also use ob_start(); but of no use[/QUOTE] Are you using …

Member Avatar for sam023
0
84
Member Avatar for cwarn23

A tutorial on how to create your first PHP page. A single step by step, that would be the easiest way to start a total noob on PHP.

Member Avatar for cwarn23
4
648
Member Avatar for ezb

[QUOTE=ezb;451365]I am currently building an online system, it has come to the point to think about securing peoples passwords. How ever, for admin reasons I was wondering if it was possible to decode the encoded password, I believe this is not possible with md5 but hoping there is another method? …

Member Avatar for digital-ether
0
762
Member Avatar for oskido2010

[QUOTE=appiee;1035164]I have stored the birthdates in the db in a YYYY-MM-DD format (just string) and want to get all birthdays from now to 7 days ahead. Timestamps are no option as far as i know (see above post). [URL="http://blog.ninedays.org/2008/02/20/birthday-mysql-query-hates-timestamps/"]Here[/URL] I found the solution to get it all by only using …

Member Avatar for digital-ether
0
4K
Member Avatar for samarudge

[QUOTE=samarudge;1033632]Hi, On my websites, I encrypt passwords using a combination of hashing algorithm (Which I am obviously not going to post on a forum but its along the lines of [icode]md5(substr(whirlpool($Value), 0, 7));[/icode]) What is blowfish, how do I use it and how much more secure is it than a …

Member Avatar for digital-ether
0
175
Member Avatar for sarithak

[QUOTE=sarithak;989641]Hi frnds.... First of all sry for all 4 arraising same(email) thread more times... I have a problem with email sendhing... one my old client ...his project is shifted from one server to another server(control panel)...now, the contact page(email) is not working properly...here i m getting the below error....plz tell …

Member Avatar for sarithak
0
105
Member Avatar for justted

Hello Justin, Security in PHP is the same as any server side programming language, they are all vulnerable to the same attacks. PHP has a history of being vulnerable mainly because of its popularity. 1) More non-security aware developers use PHP then any other language, so there code has flaws …

Member Avatar for jackiboa
0
567
Member Avatar for scias23

[QUOTE=scias23;1010958]i can't get this from working. i want to execute these two queries ebcause i want to insert data to two separate table. is it possible to do this with one query? this is what i've got so far: [CODE=php] $sql = "INSERT INTO login SET studNo = $studNo, userName …

Member Avatar for liamfriel
0
249
Member Avatar for Boronia

[QUOTE=Boronia;1009814]Hi I got a online reservation website and I am having a problems with reservation forms. Forms were ok until couple of months ago. When you submit the reservation form it doesn't go to the admin e-mails but all reservation are kept in the database. it's a php/ mysql database …

Member Avatar for Boronia
0
164
Member Avatar for lcyew

[QUOTE=lcyew;1010756]Hi. I'm doing exporting from .php to .pdf now and face a little problem here. I've found something like below and I think it might be helpful for me to do exporting to pdf. [CODE]<?php $mypdf = PDF_new(); PDF_open_file($mypdf, ""); PDF_begin_page($mypdf, 595, 842); $myfont = PDF_findfont($mypdf, "Times-Roman", "host", 0); PDF_setfont($mypdf, …

Member Avatar for digital-ether
0
143

The End.