I just wanted to do a simple thing with mod_rewrite. I have a site which uses .php files, and I wanted to rewrite those to cleaner URLs, and remove the .php. So, files would be www.mysite.com/contact and so on.
This does work how I wanted, but I had expected that it would still serve my contact.php file, but just show the user that th...
It would take too long to explain why I need this, but I was wondering if there was a PHP function to check if a type of object was recognized. In other words, a function that would check if
$dog = new Dog();
would cause an error, because Dog didn't exist. Thanks for you help.
...
I'm trying to write a script that allows an admin of a photo uploading system download all their photos at once.
Currently I am using
system('zip -r '.$_SERVER['DOCUMENT_ROOT'].'/zip.zip '.$_SERVER['DOCUMENT_ROOT'].'/images/photo-uploads';
to zip the files but this seems to echo names and locations all the files onto the page.
Is th...
Hi
Is that possible to connect mysql database between servers. I mean, lets say i have 2 accounts on 2 different hosting service, one of them has database, and i want to connect it from other one with php.
When i try it, i get "Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query..."
my data...
I'm developing some web-based software. However, commercial launch, as far as I can tell, will require distribution of the PHP code. How can I prevent this code from being pirated?
...
I wanted to create a new WordPress page that is actually a link to another site. The goal is to have the page show up in a list of my pages, but actually send the web user to the target URL.
For example, say I want to include a page that indicates "My Photos" but actually redirects them to Flickr.
I'm guessing one way to accomplish ...
I have three PHP arrays that I've encoded with json... extra PHP code has been omitted because the arrays work properly.... Additionally, the HTML tags that call the google chart have been omitted for sake of brevity...
<?php
$encoded_line_volume = json_encode($LineVol) . "\n";
$encoded_loan_volume = json_encode($LoanVol) . "\n";
$enc...
Hi all, I've got a single checkbox which i'd like the unchecked value to be 0 and the checked value to be 1, but when the post goes through, it always shows as 1 whether the box is checked or not..
Here's the checkbox:
<input name="stock[]" type="checkbox" id="stock[]"> value="1" />
here's what it spits out regardless of whether it's...
<?PHP
SMARTTAG('<PHP:DataSource ID="DataSource1" CommandText="SELECT * FROM login" Adapter="Adapter1"></PHP:DataSource>');
?>
how to use p_split or other function that result
type=DataSource
attr=ID="DataSource1"
attr=CommandText="SELECT * FROM login"
attr=Adapter="Adapter1"
i try
function SplitTag($xstring) {
$xsplit = array(...
When accessing http://www.example.net, a CSV file is downloaded with the most current data regarding that site. I want to have my site, http://www.example.com, access http://www.example.net on an hour by hour basis in order to get updated information.
I want to then use the updated information stored in the CSV file to compare change...
I have the following code presently:
if(isset($_POST['Movie']))
{
$check = $_POST['Movie'];
echo "(left angle bracket)a target='imdb' href='http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb
}
This gives me a link to click which when I do click opens in an iframe called imdb.
How do I cut out the ...
I have a site that I would like to send all of the users (20-100) text messages about 2 or 3 times a year. What are my options? and how do I implement this into a php/mysql based site?
Any and all suggestions are welcome. Feel free to let me know if I need to provide more information for clarity.
...
<?php
function foo($one, $two){
bar($one);
}
function bar($one){
echo $one;
//How do I access $two from the parent function scope?
}
?>
If I have the code above, how can I access the variable $two from within bar(), without passing it in as a variable (for reasons unknown).
Thanks,
Mike
...
ok so i'm trying to copy file.xml into another location something like copy('file.xml',../../folder/newfile.xml) ; it works just fine on my wamp virtual server but on my real site it doesn't. i thought that is something related to chmod and i changed the file.xml to 0777(with a ftp client).
is there something that i should put in my co...
I have used HTML purifier to weed out any suspect stuff coming in from my public facing WYSIWYG editor. The incoming HTML is also displayed in the public portion of the website.
I have allowed links, and I also automatically linkify URLs in plain text (using the purifier).
Is there a way to allow external links, but ban links to the sa...
Im curious to know if php has a function that allows me to connect 2 arrays together and replace values from array1 with values of array2 if the values from array2 already exist. see example
array1('value1','value2','value3',);
array2('value4','value2','value1');
array3 = functionEmerge(array1, array2);
array3('value1','value2','value...
I have a form text field that accepts a url. When the form is submitted, I insert this field into the database with proper anti-sql-injection. My question though is about xss.
This input field is a url and I need to display it again on the page. How do I protect it from xss on the way into the database (I think nothing is needed since ...
I've tried reading various tutorials online but I can't make any headway on solving this issue which is easy to describe but which I can not conceive of a solution.
Here is some sample XML:
<AAA>
<BBB>
<CCC>1</CCC>
<CCC>2</CCC>
</BBB>
<BBB>
<CCC>3</CCC>
<CCC>4</CCC>
</BBB>
</AAA>
I want...
hello, i am new to cron jobs and i have done much searching on this topic but i couldn't understand it fully. can cron jobs access cookies or session variables?
thanks!
...
Hello everyone,
I want to to make a particular processing for the last item of a partialLoop, the documentation mention about $this->partialCounter but not the variable with the total number of items ...
<?php
if( $this->partialCounter == $mysteryvariable -1 ):
?>
I am missing something I think ... cannot get my hand on that varia...