Hi,
How could I get a /22 network address from an IP address?
Like:
/24 of 193.95.221.54 is 193.95.221.0
/16 of 193.95.221.54 is 193.95.0.0
/8 of 193.95.221.54 is 193.0.0.0
/22 of 193.95.221.54 is 193.95.X.0
I'd like to cache GeoIP data for 1024 IP addresses with a single cache entry to conserve cache space and number of lookups (Ge...
Hi. I'm using file_get_contents to get a certain files contents. So far that is working. But then i would want to search the file and replace all <a href=" with <a href="site.php?url= before showing the file. How can i do this? I know i should use some kind of str_replace or even preg_replace. But I don't know how to actually search and...
Hi I know about several PDF Generators for php (fpdf, dompdf, etc.)
What I want to know is about a parser.
For reasons beyond my control, certain information I need is only in a table inside a pdf
and I need to extract that table and convert it to an array.
Any suggestions?
...
[QUOTE=php_lover;4343082]Hi all , I've writen a piece of code downloading file from mysql , here is the code :
php code :
$query = "SELECT name, type, size, content ,downloaded FROM ".filtering($cat , 'str')." WHERE id = '".filtering($id , 'int')."'";
$result = mysqlquery($query) or die('Error, query failed !!!');
list($name, $type, ...
Please, see this answer to see the main problem.
How can you solve the following error message in prepared statement?
I have a index.php to which I put data through many handlers. The following error message occurs at the following URL that is a URL after a login form.
http://localhost/codes/index.php?ask_question&email=masi.mas...
I have a drop down menu that I am dynamically populating based on values in a database table. The code looks something like this:
<select>
<option value="" selected="selected">Select Option</option>
<?php foreach($var as $row): ?>
<option value="<?php echo $row->value;?>"><?php echo $row->value;?></option>
<?php endforeach;?>
</sel...
I had been wondering why my error page caused certain pages of my site
not to render, but then I realized that it's because AppError extends
ErrorHandler instead of AppController. This caused some variables
that I set in AppController's beforeFilter method not to be sent to
the view. Since I can't access session variables from AppError...
I've run into a hard problem to deal with. I am replacing a-tags and img-tags to fit my suggestions like this. So far so good.
$search = array('|(<a\s*[^>]*href=[\'"]?)|', '|(<img\s*[^>]*src=[\'"]?)|');
$replace = array('\1proxy2.php?url=', '\1'.$url.'/');
$new_content = preg_replace($search, $replace, $content);
Now my problem is tha...
I have a database storing "wiki formatted" text which I would like to display in XHTML using PHP.
Here is an example output with all the wiki markup:
Default text
== Heading 1 ==
=== Heading 2 ===
==== Heading 3 ====
===== Heading 4 =====
====== Heading 5 ======
'''Bold'''
''Italic''
<s>Strikethrough</s>
* List item 1
* List item 2
#...
I have simple form posting to another file. The problem I'm having is with TEXTAREA field.
In the form TEXTAREA, I enter this:
<h1 class="padlock">Member Login</h1>
and the Output is on the other page when echo with PHP:
<h1 class=\"padlock\">Member Login</h1>
It's automatically escaping characters. I'm displaying the output in a...
I put the variables email and password from POST to GET such that
Part of my *handle_login_form.php*
header("Location: /codes/index.php?ask_question&" . "email=" . $_POST['email'] . "&" . "passhash_md5=" . md5($_POST['password']) );
The user then clicks the About link. He should have the login info in the url, but he does not. He ha...
I'd like to use Zend_Tool (ZF 1.9) with my project, but I would like to be able to customize the default output of new files. For example, all Controllers should have a specific header pre-pended to the output with phpdoc markup and licensing information to avoid me having to add this as an extra step.
Also, for this particular project ...
I've got some sample code that I'd like to refactor as I need it to work after a record is saved. It currently works after the record is first rendered (using the afterFilter). What it does is render the view that I want with the layout and saves it to a file.
function afterFilter() {
parent::afterFilter();
if($this->params['pas...
Say I want to insert into name, address, city, state, zip values $name, $address Etc.....
How can I run mysql_real_escape_string on each of the variables before inserting. There has got to be a foreach or loop or while method instead of writing out each variable right?
Thanks for the help.
Tom
so if I have
$data = array($address...
Hello. I'm trying to send a form to a PHP using $.ajax in Jquery. I send the whole thing as JSON, but, when I try to get the response, i get the 'parsererror'. What am I doing wrong? Thanks in advance.
Jquery fragment:
$("form").submit(function(){
$.ajax({type: "POST",
url: "inscrever_curso.php",
data: {cpf : $("input#cpf...
Im looking for a really nice jquery image streamer/slideshow plugin.
Something unobtrusive, that can take a group of images and fade through them and then update the list when done.
Something thats not basic, something that you can sit back and watch and incoming stream of uploaded photos.
...
Maybe I'm doing something wrong right from the beginning, and if so I'll work on that too...
I have a menu item that as part of the URL passes an Event ID#. In my specific case it takes the user to an information page for that Event. Then there is a button that lets them sign up for the Event. Click and they're signed up for the Even...
When writing a PHP application which search index should be used if you want to index a lot of documents in a clustered fashion. Is there a simple library to do the job? Is there something like lucene for php?
...
This is what I have so far:
<?php
$text = preg_replace('/((\*) (.*?)\n)+/', 'awesome_code_goes_here', $text);
?>
I am successfully matching plain-text lists in the format of:
* list item 1
* list item 2
I'd like to replace it with:
<ul>
<li>list item 1</li>
<li>list item 2</li>
</ul>
I can't get my head around wrapping <ul> ...
I have read 3 posts on SO about how to do this, but its not working for some reason.
On the page index.php, i have this script:
<script type="text/javascript">
function update() {
$.get("index.php", function(data) {
$("#uploadcount").html(data);
window.setTimeout(update, 5000);
});
}
</script>
and then this div, also in...