I realise lately whenever i refresh the upload.php page, the browser will keep uploading the file into my database. How to come up with a code that can make the browser check if the file exist in database, if doesn't exist, then shall upload to database?
Strictly speaking this is a question about .htaccess, but I'm using that to solve a problem with Wordpress and it's plugins which are PHP code I've been tinkering with. Hopefully someone has some ideas; I've not had any luck elsewhere.
I'm using an extensively modified version of Bunny's Technorati Tags to tag my posts on a wordpress site. I've been trying to implement David Gagne's Hack (http://www.davidgagne.net/?p=6179) to make the tags link to my own site search rather than to technorati. Which involves using .htaccess to re-write tag urls to the search page.
The difference between my site and Dave's (where it works) is that he is not using url re-writing on his article posts whereas I've used rewriting to have /category/title urls for posts.
I've put the suggested rewrite rule into my .htaccess, but it still 404's and I've not managed to figure out a solution
Hello everyone, Lately, I wanted to set a form of activation for the user, so that they can choose to activate or deactivate the picture. If activate, the picture will be shown in the home page, if deactivate, then it will not be shown on home page. I find some resource about setting this activation using boonlean value true or false or 0 or 1. However i could not really find anything relating this boonlean using PHP. Care to give me some website on boonlean in PHP or some helps, where i can use it to activate and deactivate the pictures for my website? Thank a million! :)
Out of curiosity, since I'm having a heck of a time finding information on this:
What is the difference (if any) between using self::function() and $this->function()? Specifically, I'm looking at adapting the singleton pattern described here for my own use and want to understand why they've chosen to use the self keyword.
I don't know whether if this is a PHP or Javascript question, or both?
I'm working with many checkboxes and textareas and they are both side to side.
By ticking many/one checkbox(es), content in "selected" textareas will be saved into the database when i click the submit button. But how? Has it got something to do with the values of the checkbox?
Is this done just by PHP or do i need to use Javascript? I need some hints, thanks! (:
//below is a while loop to generate table rows and increment in values (of the name [textarea1,2,3 and so on])
$number_t=1; $number_c=1; $value_c=1; // Get each row of data on each iteration until there are no more rows while($row = mysql_fetch_array($result)){ echo "
"; echo "
"; echo $row['ph_name']; echo "
"; echo $row['text']; echo "
"; echo "echo $number_t; echo "'onBlur='check(this)'>"; //this part is for a Javascript function that checks the checkbox when textarea is filled in echo "
I have this include .htm inside my .shtml this way I just have to update this one file for my web site at the top. It is my current count of my business cards www.cardeologist.com Anyways, on my pages with the .php file it won't work. Is there a way to get it to work? Example it works on www.cardeologist.com/index.shtml but it won't work on www.cardeologist.com/contact.php
I posted a comment today and received the following message:
Success
Your comment has been added. According to this community's settings, it was marked as screened, and will be visible only to you and the community maintainers until they choose to unscreen it. You can view your comment here.
Hello! Can anyone help me with saving the file to it server? Because currently i manage to upload the file into my database but not to the server itself. I know i have to use a function known as the move_upload_file but i'm uncertain how on how i can move it to this directory C:\Program Files\mysite\images. Please help! thanks a lot for the help. :)
0) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; move_uploaded_file($fileName,$tmpName); $filename= "\Inetpub\wwwroot\tpi\images\$fileName"; //?? this is the part i'm facing
Anyone have any idea why after establishing a pconnect with my MySQL server previously in the script when I try and run a query later on (without closing the connection) it throws the following error :
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\movies_dev\movies.php on line 18
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\movies_dev\movies.php on line 18
Ignore the line numbers infront of the code behind the cut, I pasted it on a pastebin and it threw it's own line numbers in and I don't have the time to cut them out.
64. Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\movies_dev\movies.php on line 18 65.
66. Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\movies_dev\movies.php on line 18 67. Error with query /# 1
I was curious where to look for info on how to access files and directories (and any constructs/modules/functions) that may help with file management in a Windows environment? Or any changes that need to be made to php.ini or any other file. Basically I want to be able to access and control files and folders from within a webbrowser or a command line with this script and be able to have it store filenames, data structures, etc. to my database. Also wouldn't mind some data mining functions as well, as windows search doesn't work too well and I'm still trying to find a good grep for windows.
I want to find out the dimensions of an image, in pixels, if scaled proportionatly.. so for example the max image size is 800x600 and I have an image which is say 100x300 and another which is 900x400..
so when scaled proportionatly how would I find the bigest size image I can fit in the max size?
I have php + gd, no imagemagik and I dont need to display the image, just calculate it's size... can anyone point me in the right direction?
How can I instantiate an object whose name I learn at runtime? What I mean is something like $view = new $viewName, where $viewName is a string representing the name of the object I wish to instantiate. One way I can think of is call_user_func(array($viewName, 'staticFactoryMethod')), but I suspect there might be a better way.
This is for an application to which operators may add new interface rendering code, as a class implementing a specific interface, and then cause any page in application to be rendered by the new view plugin by including a string in the request URI corresponding to the name of the class to be instantiated. So, basically, a sort of dynamic plug-in system.
Hello everyone. I have a web service sort of like a gallery written in PHP, and I'd like to make it externally accessible to use in other remote applications. I was thinking of using the SOAP protocol, but it's hard to find how to write a SOAP server in PHP (everything I can find is making a SOAP client.)
Anyone that could point me to a tutorial, give me a simple example, or point me to another protocol that's easier to write for (XML-RPC) would be great help. Thanks!
P.S. This will all be for internal use, so functions don't need to be exposed, and such.
I'm looking for a php-based IMAP client. I'm looking for one that can work like thunderbird or outlook, in that it can allow a user to check email for multiple accounts on one "screen" (instead of the current system, where I have to log on to webmail for each individual email address. bah, what a pain!) What are my options (bar just writing my own?)
As part of a development project, I'm currently developing a site which will require user login to access most of the actual site content. However, I want to ensure that I set this up with the most common security holes taken into account.
The user data is stored in a MySQL database, with the username stored in cleartext and the password field contains the md5 hash of the actual password concatenated with a 10 character random salt string (which is stored in the database as cleartext).
Login form data is passed via POST. Any data that is taken from or generated from the user will be passed through a sanitization function to prevent SQL injection attacks.
To track the user's state, I am looking into using session variables. My current problem is how to determine if the user has been authenticated properly, ideally without having to make a database call on every single page where this needs to be verified.
Does anyone have any suggestions as to some ways to authenticate the contents of a session to prevent man-in-the-middle/replay attacks? The obvious way would be to store the session ID in the database and check it every time, but that adds a lot of overhead.
Also, if anyone can spot any glaring security issues that I've missed in the descriptions above, I'd really like to hear about it. I want to do this right the first time.
i have a problem and i hope you guys can help me out. why does when the hintchar is actually equal to wordinput, it appears as "you have entered the wrong hint". ?
function generate_hint($wordinput, $hintchar) { $progress = mask_string($wordinput); for ($i=0; $i<=strlen($wordinput)-1; $i++) {
if ($hintchar == $wordinput{$i}) { $progress{$i} = $hintchar; }
To anybody who might be using Komodo v3.5 to edit files over ftp:
backup your files.
I have been working in a file for two weeks, Komodo crashed and all my code disappeared. Gah. Fortunately I have the backup on the server from a few days ago, but watch out, Komodo will eat your filez.