Hello guys, I have datetime-row in mysql database. I have to check time between now and that date using php. If the range is bigger then 1 month - do somtething.
I tried something like this:
$dateFromMysql = strtotime($rowData);
$currentDate = date("m/d/y g:i A");
And then comparsion by hands. It's ugly.
Hey guys, I currently present my mp3s by referencing their file location into a flash mp3 player for the users. Is is possible for users/bots to go onto your site and somehow execute an mp3 continuously and drain bandwidth? If so how can you prevent this? (I program in php). Thanks in advance for any advice.
$key = file_get_contents('http://keyserver.pramberger.at/pks/lookup?op=get&search=uid');
after getting public key in '$key' variable i need to encrypt the data using this public key.
the key must be start with ----Begin pgp block ---to end pgp block----.
How this can be done in php?
I try extend an core class.
But catch error:
Warning: include(
\\\\\\\\\\\\MyModule\Ajaxsearch\Model\Resource\Eav\Mysql4\Product\Collection
\\\\\\\\\\.php) [function.include]: failed to open stream:...
Why magento add slashes to addres? May be config error?
I would like to access a bazaar repository and pull code from it with either a Python or PHP script.
How is this done? Is there a Python module / PEAR library that makes this easy?
If it helps, the repository is on Launchpad.
I using php's str_replace function to replace some text. Example below.
str_replace("{x+{\$v}}", "{x-{\$v}}", $this->introtext);
str_replace('{x+{\$v}}', '{x-{\$v}}', $this->introtext);
In first case it replace text, but in second case it is not doing so. What is difference between two?
i need to create a PHP script to create the insert query to insert in a table,
The table from which I need to fetch out the data to create insert query is given below..
The query has to be like this
INSERT INTO table_name (field1,field2, field3...) values('newvalue','newvalue','newvalue',....)
Please Help...
Thanks
I am working on a PHP framework and am currently designing error handling. Based on what I have read on SO, I should only use exceptions for, well, exceptional situations. Therefore throwing an exception when an incorrect password is entered is wrong.
Should I avoid using exceptions when I want to trigger a server error? If so, should I write my own error handling class?
I have about 40000 records in that table that contains plain text and within the plain text, contains that kind of tags which its only characteristic is that they are braced between [ ]
[caption id="attachment_2948" align="alignnone" width="480" caption="the caption goes here"]
How could I remove those? (replace by nothing)
I could also run a PHP program if necessary to do the cleanup.
I have a application which runs over browser ...php application... i need to lock this application to only few machines and laptops that we allow to access. IP locking cannot be done as laptops can be on wifi from outside... Any Idea on how to do this?
Currently I am using ctype_alnum to check for alphanumeric type in csv file. But one of my data has white spaces between them and so ctype_alnum gives me false.
Example: ctype_alnum("Here is 23");
So my question is how can I check for white spaces in string in php ?
I'm trying to convert a simple url (below) in to a blog-style url, but not quite sure how to do it, all of my other rules are working fine, but I can't seem to figure this one out.
URL I want to convert: http://www.website.com/myblog.php?id=1&title=My+blog+title
URL I want it to create: http://www.website.com/1/my-blog-title
What should the rule be?
Any assistance appreciated :)
Hello,
Consider the URL www.something.com/HereWeGo. When someone enters the url, the site shows a 404 error since the directory does not exists. I can parse the URL to get the query and HereWeGo, but cannot stop it from going to a 404 error.
How can I achieve it by PHP, if it is possible to avoid .htaccess now
Thanks
Jean
hello
i use of php and jquery in my application
i want when users submit success a form in page1 , forward form page1 to page2 and show a pop-up message "success" and when they do not submit success , dont forward and just show pop-up message "error"
how i can implement this process?
thanks?
I am writing a simple REST service, which responds to requests from clients. All in PHP.
My concern is, that when my server responds to a request, it could end up tying up resources if the client side is too slow in sending back "ok" response.
How do I send a POST request via lib_curl setting it to not wait for any responses, but rather quit immidiately after the POST data have been sent?
Is this even possible? Thank you !
Hello all,
I am not sure if its possible but I would like to create some sort of function where you pass in a string such as "yellow" or "green" and it returns its hex code or the range of hex codes that greens or yellows fit into.
Is this possible in PHP? If not possible, I am willing to try anything else that can do this!
Thanks all
I find myself doing the following or similar quite often:
Request::instance()->redirect(Route::get('route')->uri(array('action' => 'action')));
Or:
Request::instance()->redirect(Route::get(Route::name(Request::instance()->route))->uri(array('action' => 'action')));
I'm wondering if there's any short, easier, simpler way of doing this. I love the Route functionality, but it makes for some long lines of PHP.
I am designing a desktop application in C#, which needs to be connected to my online mysql database. I tried to give access in control panel a "%" which means from any IP, but it is not working. May be the hosting provider (bigrock) not allowing that.
Alternatively, I am trying to write some code in online on PHP which will get the "sql" as parameter and returns the output as JSON format using json_encode.
Is there any alternate methods which is better approach.
I'm frequently using the following to get the second to last value in an array:
$z=array_pop(array_slice($array,-2,1));
Am I missing a php function to do that in one go or is that the best I have?
Hi.
I'm about to develop a small web gallery, where it's supposed to be possible to upload several pictures at a time and then add some info abut the pictures.So I need a free java or flash local file browser that can pass me some info of the pictures that gets uploaded so that I can create some SQL entries for each picture.
The platform for the project will be PHP and MySQL.
Any good recommendations?
I am a new programmer, and I started in C and am now starting to enjoy JavaScript and a tiny bit of PHP more. Lately I've heard the terms 'private' and 'public' functions a lot. Could anybody give an explanation of the both and how they are of use to a programmer?
And I'm probably totally wrong here... but is a
(function(){})
in javascript a private function?
I have my mod_rewrite set up so that it redirects all requests that aren't targeting existing files or directories to index.php?req=* where * is the request.
Works all fine but when I send the browser to something like this:
http://myurl/A/B/C
The browser tries to find all images, stylesheets in the non-existing folder C. How can I make the browser to look in / instead of the 'virtual' directory?
Do I have to put an absolute path everywhere?
hi all actually when i use link syntax like
<?php echo $html->link('Home', '/notes/index');?>
but when i used
<a href="/cake/cake_startab/notes/index/" alt="Home">Home </a>
its woking why????
Hi
How to protect files (documents, images..) that r being sold over internet.
Is it possible to Deny access to all except a particular php file that lists those documents.
for instance www.mysite.com/list