There were many valid comments on this thread. I've finally had time lately to address the problems with my article by uploading my InputFilter class to phpclasses.org.
The Blurb: This class can filter input of stray or malicious PHP, Javascript or HTML tags. It can be used to prevent cross-site scripting (XSS) attacks.
It should be used to filter input supplied by the user, such as an HTML code entered in form fields. You create the filter object, configure it with your own settings, then call its process method to clean the form input values.
i finally installed php5 as a cgi on my server because the server company has not upgraded to php5 yet. PHP5 runs only in 1 specific directory.(.htaccess file) Php appears to work fine as php5 but now i can't get it to read the mysql db.
the mysql library is compiled and i don't get an error when the connection string is called. the results from the query just doesn't appear. I'm definite it's not the php code because I haven't altered the code.
Anyone have any idea as to why? -Thank you all in advance!
here is the php code: maybe something changed w/ php5? $sql="SELECT categoryid, category FROM t_category ORDER BY category ASC"; $result=$this->f_selectquery($sql); foreach ($result as $key => $value) { echo " \n"; }
here is the configure command. './configure' '--prefix=/home/acctname/php' '--enable-force-cgi-redirect' '--with-xml' '--with-libxml-dir=/home/acctname/php/lib' '--enable-soap' '--with-xsl=/home/acctname/php/lib' '--with-mysql=/home/acctname/php/lib' '--with-curl=/home/acctname/php/lib' '--with-mhash-dir=/home/acctname/php/lib' '--with-mcrypt-dir=/home/acctname/php/lib' '--with-zlib-dir=/home/acctname/php/lib' '--with-jpeg-dir=/usr/' '--with-png-dir=/usr/' '--with-gd' '--enable-gd-native-ttf' '--enable-ftp' '--enable-sockets' '--enable-wddx' '--with-iconv' '--enable-soap'
here are the mysql properties under php MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 4.1.8 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/run/mysqld/mysqld.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib -lmysqlclient
Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off
HI there. I'm having major troubles, and headaches, over a new layout I want for my website.
Pure css gave me a nightmare so I decided to use PHP includes, and that way have my site easier to overhaul each time I got bored. Now, I've not had anything to do with PHP before, and rather than encode each piece by hand, I just made my headers, and footers, and renamed the content of each page whatever.php (please don't point and laugh at me, I have no idea what I'm doing with PHP ...)
My test page shows up perfectly in IE, but there is only a small space for the menu in Firefox. I have tried everything from resizing divs, taking divs out, etc etc and nothing has worked.
I want a site with no tables, and no frames that is cross-browser compatible.
I'm going to lose my mind soon, the whole idea of me forsaking my beloved frames layout was to become more user-friendly. What the heck am I doing wrong? :( Any suggestions are muchly appreciated. I use Firefox myself, and I'd hate to have to force people to view my page in IE ...
I do a check at the start of every page to see of the user is logged in or not. If the user is not logged in I send them to the login page.
My client wants to be able to log in and then be taken directly to the page that they were trying to view before logging in.
I thought that I would be able to get the referring page from $_SERVER['HTTP_REFERER']but its blank when I ever I test for it. It works perfectly when I logout out of the system (this also sends you to the login page). It shows me the page that I logged out from.
So I am guessing that because you actually don't load the page you request before PHP processes whether you are logged in or not, it never gets stored in $_SERVER[''HTTP_REFERER'].
So my question is, how do I tell what page it came from?
Here is the code that handles sending you to a new page.
I'm trying to use the DOM functions to play with some XML, but it seems as though my server PHP version doesn't include them.
I do have access to the webhost manager type deal, but didn't see anything pertaining to PHP in it really. I've also looked through php.net, google, and the documentation, but saw nothing related to remote installation or additions. So either it's like I said, the server version being outdated, or I'm doing something else wrong.
Would I be able to configure the remote server to include new PHP functionality, or is there some other way I don't know of to use the functions?
Just wondering if there is cms expert around. From some of this list below which one would you recommend (Rank the first 3)? Or if there is something else that you like and its not in the list...post them up :D
Drupal Geeklog Mambo Open Source PHP-Nuke phpWCMS phpWebSite Post-Nuke Siteframe Xoops
Is there similar features in Linux to send form mail (I'm using MailEnable in my window hosting. I am still learning PHP ) or ready to go reliable PHP Form Mail code (besides Matt's form mail) ? I found this http://phpfmg.sourceforge.net/home.php which looks quite good but haven't tested it yet.
If you want to apply, email me at sandra.lumia@gmail.com! Please note that I don't accept manga focused artists! I must like adore your creations, because it's my bandwidth I'm giving away here. Please note that hotlinking will be strictly forbidden!
What I'll give you: 30 MB webspace (for the beginning, later maybe more) No ads! Subdomain that looks like this: http://yourname.stagedweb.com FTP access Email account: yourname@stagedweb.com CGI, PHP
I'd like to give good artists who can't afford a server the opportunity to publish their work properly. If you're accepted I expect you to update the site at least once a month! You must be a good webdesigner! When you apply send me samples of your work!
Hi all I am trying to use a javascript to confirm the deletion of a user in one of my PHP programs. I am using the javascript function confirm(). They way I read it, if the user presses cancel, all action from the form should stop and the browser will remain on the same age. If the user presses ok then the action of the form should be followed out. However whats happening is that no matter which button is pressed the action of the form is carried out. Am I missing something really obvious?
Here is the javascript :
function confirm_delete()
{
var msg = "Are you sure you want to delete the user?";
if (confirm(msg))
//window.alert("Delete");
location.replace("delete_user.php");
else
//window.alert("dont delete");
location.replace("list_users.php");
}
And here is the form line that calls it :
form method="POST" name="delete_user17" action="delete_user.php" onsubmit="confirm_delete();"
input type="hidden" name="user_id" value="17"
The FAQ says that the CGI binary is included, and that it is installed in /usr/local/php5/bin. However, it appears to be the CLI version, not CGI:
$ /usr/local/php5/bin/php -v PHP 5.0.3 (cli) (built: Mar 6 2005 22:13:21) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies
Is there something I'm missing? Can this function as the CGI version? What I'm most interested in is having the $_GET and $_POST superglobals working. As it is, they're initialized as arrays, but aren't populated with any of the actual POST or GET data. (Same for $HTTP_GET_VARS and $HTTP_POST_VARS.)
I'm trying to create a PHP browser-based chat room application. It will include Savant, JPSpan, and a custom MySQL wrapper class. The server is running PHP 4.3.10 and MySQL 4.0.18-standard. Now that the background information is out of the way, to the real issue at hand...
I obviously want the application to be able to support as many users as the server will allow. That said, the application must be as efficient as possible in terms of the database design and implementation. The database will be relational in design. There will be tables for rooms, users, and posts made by users to rooms. The application will also include a feature to allow users to search posts. My plan at the moment is to use a HEAP table as a buffer for current posts, given that they provide a speed advantage because they exist in memory and use hash indexing. On some sort of timed interval, posts would be moved from the HEAP table to a separate permanent table for archived posts.
However, this approach would require that posts be archived regularly over the course of the day. The more frequently posts are archived, the smaller the number of posts that could potentially be lost due to a server crash, power less, etc. The HEAP table really only needs to hold posts long enough for them to propagate to users. I'm not certain what frequency would be best.
Also, because HEAP tables don't support the TEXT field type, the HEAP table would initially need a VARCHAR(255) field for the post body. The application would have to check the length of posts when users submit them and then ALTER the table to add additional VARCHAR(255) fields, split the post body up to store it across those fields, and then concatenate the value of those fields to display the post. Since displaying each post would require getting all fields in the table anyway, it should be fairly easy for the application to figure out with each display how many fields it needs to concatenate to display the post body.
Any input? Any alternative approaches? I probably neglected to mention some tenant of my application requirements, so if you have questions, please ask, and I'll most certainly answer them. I think I've covered most of the bases, though. HEAP tables are a new concept to me, so I'm mostly lingering in the world of hypotheses before I actually try to make this work.
Hi, I do not know how to code PHP, but I do know how to impliment PHP scripts. I've been looking for a GPL one that does the following:
Forces download (header script that forces the "save" dialog. I'm serving mp4s and I want to make sure they don't load in the browser).
Anti-Leech (hides the true URL of my mp4s, and allows only referring servers I've entered into the script to download, otherwise people are redirected to the page of my choice)
Download Counter (either flat files or MySQL).
And that's it. I found scripts that do bits and pieces of this, but only one that does it all—and you have to pay for it (you can actually use it for free but it appends the site's name to the downloaded files unless you register the pro version). This script is called "Download Center Lite" and can be found at www.Stadtaus.com. I tried to crack it, but they've done clever things in the script to prevent that.
Also, I've found "Download Centers" that do much of these, but that's just for having a specific page with download links. I want to be able to dynamically call to these mp4 links from various pages on my website, not just from one.
Ideas?
This message was also posted in the LJ community "PHP."
Hi, I do not know how to code PHP, but I do know how to impliment PHP scripts. I've been looking for a GPL one that does the following:
Forces download (header script that forces the "save" dialog. I'm serving mp4s and I want to make sure they don't load in the browser).
Anti-Leech (hides the true URL of my mp4s, and allows only referring servers I've entered into the script to download, otherwise people are redirected to the page of my choice)
Download Counter (either flat files or MySQL).
And that's it. I found scripts that do bits and pieces of this, but only one that does it all—and you have to pay for it (you can actually use it for free but it appends the site's name to the downloaded files unless you register the pro version). This script is called "Download Center Lite" and can be found at www.Stadtaus.com. I tried to crack it, but they've done clever things in the script to prevent that.
Also, I've found "Download Centers" that do much of these, but that's just for having a specific page with download links. I want to be able to dynamically call to these mp4 links from various pages on my website, not just from one.
I'm used to telling time in [hour]h[minute], for example, 8:25pm would be 20h25. (I grew up speaking French; most of my web sites are bilingual.)
Anyway, I'm wondering how I can format the php timestamp of a phpBB (or any other php page), so that I can write it that with the 'h' in the place of the standard colon.
Right now, I have my the timestamp on my profile set to M d H:i; I would imagine if I were to write it as M d H h i, the second 'h' would just repeat the hour time.
i'm looking for a good webhost company to host my website. what are your recomendations?
my needs are pretty standard.
- php (5 would be nice) - mysql - ftp - email - subdomains - +200mbs space - +20gbs bandwith - CPanel, URCHIN statistics are a plus - if possible, ssh access. :)
so far, and based on my past experience, i'm set on using eyow.com. but i want to hear what you guys recommend.
(sorry if there is a list somewhere of recommended webhosts. i've searched the lj communities and nothing has come up.)
i'm looking for a good webhost company to host my website. what are your recomendations?
my needs are pretty standard.
- php (5 would be nice) - mysql - ftp - email - subdomains - +200mbs space - +20gbs bandwith - CPanel, URCHIN statistics are a plus - if possible, ssh access. :)
so far, and based on my past experience, i'm set on using eyow.com. but i want to hear what you guys recommend.
(sorry if there is a list somewhere of recommended webhosts. i've searched the lj communities and nothing has come up.)
Does anyone know how to stop the spam bots from posting on guestbooks? I have a few sites up and I have to monitor all the php guestbooks for bot posts.
And some of the posts I can't even delete. I know HTML and basics but my friend made me the PHP guestbook so I don't know it 100%