php

.htaccess file modification

Hello, I have a .htaccess file which arranges that all requests go through index.php. Now i would like to make an exception for rss.php. to go straight throuh rss.php. How do I do this? This is how it looks like now: RewriteEngine on RewriteBase / RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php Thanks. ...

show resized image by browser

Dear all, My below PHP code show a image on browser as its original size 300x300. <? $location="http://localhost/folwer.bmp "; header("Location: $location"); ?> But I need to show it 120x240 or any other size on browser. How can i do it without resize the original image using PHP? Pls help. ...

MySQL: Fulltext indexing previous records?

Hi All, I added a FULLTEXT index on three of my columns, after I already had a bunch of records...does that mean the FULLTEXT won't index them and will only index records inserted after the FULLTEXT index was added? If so, anyway to reindex the whole database? ...

How do I add more than one row with Zend_Db?

I have an array with information which looks more or less like this: $data[] = array('content'=>'asd'); $data[] = array('content'=>'asdf'); And I want to add both entries into the Database. $db->insert('table', $data); does not add both entries. What am I doing wrong? Do I have to use Zend_ Db_Table? $data = array('content'=>'asdf...

php foreach help

I have a dataset with 4 rows. I am using 2 foreach loops to get my data out. The outer foreach needs to loop once and I need the inner loop to loop 4x. Is there a way to do this or do I need to split the array? foreach($reports as $key=>$val) { if($val['rpt_type'] == 'Sooa') { foreach($val as $foo) { ...

To use a PHP framework or not?

I've started writing quite a few applications in PHP mainly for Wordpress and becoming more and more familiar with the language. Someone told me about CakePHP and Codeigniter and I wanted to get a better understanding of how these could help me and whether it's worthwhile spending the time to learn a framework? Thanks Jonathan ...

How to append variables to a url which already has variables?

Hi all, So, the situation I'm currently in is a wee bit complicated (for me that is), but I'm gonna give it a try. I would like to run to a snippet of HTML and extract all the links referring to my own domain. Next I want to append these URL's with a predefined string of GET vars. For example, I want to append '?var1=2&var2=4' to 'ht...

C#: Problem running shell commands

I'm trying to get the PHP parser to run a page and then return the results to my server, however when I run the command via my code, it returns nothing. I know the command is correct because if I run it manually with the same path, it works fine. Heres my code: var p = new Process { StartInfo = new ProcessStartInfo("C:\\xampp\\php...

php,image download

Hi, when users upload the image i save it to the image folder in htdocs directory. so any user without logging into site can go type the url/images/"name" would get it. what is the best way to prevent this. since the browse would just request just like the user typing directly in the address bar the location of the image. I was thinking ...

PHP/MySQL Update code

I'm trying to call a row update from php to an mysql database. It fails out but when i try to call an insert new row formated just the same it works. $result = mysql_query("INSERT INTO auth (username, password, studycode, description, server) VALUES ('$username', '$password', '$studycode', '$description', '$server')"); but this code f...

how to list wordpress categories by alphabet ?

ok so this is what i mean by this. on a the category archive page it will list all the category so that it look like this: "a" ---apple ---answer "b" ---ball ---big and so on. and this is wordpress i am talking about. thank you very much ...

Read in text file line by line php - newline not being detected

I have a php function I wrote that will take a text file and list each line as its own row in a table. The problem is the classic "works fine on my machine", but of course when I ask somebody else to generate the .txt file I am looking for, it keeps on reading in the whole file as 1 line. When I open it in my text editor, it looks just...

What's the best way to implement a "soft" save or modification workflow?

I'm working on a MVC based web app on LAMP that needs some records to be modified only under the approval of a "superior" user. (The normal user can submit changes but they get applied only after this approval) There are is only a table in which this would have to take place, say "events": EVENTS - id - name VARCHAR - start_date DAT...

How to send emails with PHP from a heavily firewalled network?

I wish to send an email from my localhost machine (using PHPs mail function) but I can not do this since I don't have a mail server. In addition, I need to be able to send emails through a network that is heavily firewalled (to what extent I do not know yet). My idea is to make use of "QK SMTP Server 3" and get that to use an external s...

Why doesn't Google OpenID provider work with PHP-OpenId on my server?

Hey, I'm using PHP-OpenId 2.1.3 which I've unzipped on my server here (this is the consumer example that comes with PHP-OpenId). When I enter the Google OpenId url (https://www.google.com/accounts/o8/id) and submit I get a blank screen. When I try the exact same example code on the PHP-OpenId website here with the same URL it works fin...

PHP SID not showing

Hi, I cannot get my SID working ... <?php session_start(); // Or maybe pass along the session id, if needed echo '<br /><a href="page2.php?' . SID . '">page 2</a>';?> does not show up SID number but session_id is working not sure if I am missing something. THnks ...

Is my email header correct?

Hello all, Is the following "From" header incorect? // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: Mail Master <[email protected]>' . "\r\n"; if(sendEmailNow($email, $s...

php isset do you need it in a form check?

Hi, I trying to understand if a isset is required during form processing when i check $_REQUEST["input_name"] if no value is passed it doesn't cry about it and php doesn't throw out an error if you are trying to access a array item which doesn't exist....i can use if($_REQUEST["input_name"]).. what about "empty" even in those cases i can...

PHP: mysql_fetch_array() in a while-loop takes too long

I am creating an online calendar for a client using PHP/MySQL. I initiated a <table> and <tr>, and after that have a while loop that creates a new <td> for each day, up to the max number of days in the month. The line after the <td>, PHP searches a MySQL database for any events that occur on that day by comparing the value of $i (the c...

mysql syntax problem

I'm trying to display info from a mysql row on this page. I'm using $_GET, because the id is included in the link to the page: www.example.com/page.php?id=1 but it returns this error: Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= '1'' at l...