Jump to content

chasethemetal

Members
  • Posts

    169
  • Joined

  • Last visited

Posts posted by chasethemetal

  1. Hey all,

     

    For the life of me, I can not figure out how to pass the X-Forwarded-For header to PHP via fastcgi.

     

    I am running Nginx, it has been configured with all modules.

     

    Does anyone have any suggestions for getting the visitors real IP address from behind a rackspace loadbalancer, in Nginx and passing to fastcgi?

     

    Thanks so much.

  2. Move those files behind the public directory. Not sure what your folder name is but, it looks like public_html/scripts/php/myscript1.php right now. So make a folder next to public_html called scripts/ now your include will be include '../scripts/php/myscript1.php'. No need for any .htaccess, plus the .htaccess file still exposes your directory structure. Solution, move all PHP behind the public wall making it impossible to access from the browser directly

    /home/user/public_html/ *all website, html, js, css, images*/home/user/scripts/ *php and such here*

  3. Hey All! I currently running Nginx as my web server, and I want to create a kind of catch all domain name handle, but cant seem to find any documentation on how to do this. Heres the use case... Lets say I changed the A Record for a site "superawesometest.com" to point at my server. But on my web server, running Nginx I don't have a site listening for that domain name. So instead of throwing an error, or sending the request to my Default Site, I want it to handle it by passing the requested domain name as a query parameter to a handler domain name. i.e. www.superhandler.com?requested_uri=superawesometest.com Any thoughts on how to do this? Thanks so much.

  4. Hey all! What option do you think will scale better? To have 1 big select statement joining columns. Or multiple small queries to retreive the same information. Let me illustrate what I mean exaclty. Table2 and Table3 could have millions of records while, Table1 would only have thousands. The big select with Joining

    SELECT table1.uri, table1.name, table2.random1, table2.random2, table3.something1, table3.something2FROM table1, table2, table3WHERE table1.id = 1 AND table2.id = 1 AND table3.id = 1

    Multi small queries

    SELECT uri, name FROM table1 WHERE id = 1SELECT random1, random2 FROM table2 WHERE id = 1SELECT something1, something2 FROM table3 WHERE id = 1

    Thanks!

  5. Hello! I have 2 pages, the parent document and mulitple iframes in that parent document. In the iFrames I am trying to target it's own class attribute... <iframe class="frame"></iframe><iframe class="frame"></iframe><iframe class="frame"></iframe> So inside each iframe I have a function and I am trying to clear its class! But I can't figure out how to target itself!!! So I do the function in the first <iframe> and it should look like this now <iframe></iframe><iframe class="frame"></iframe><iframe class="frame"></iframe> Any help would be appricieated thanks!

  6. Hey all! I am trying to serve some MP3's through a function but am running into a little problem. Here is my code

    header( "Content-Type: audio/mpeg;" );header( "Content-length: ".filesize( $media ) );header( "Content-Transfer-Encoding: binary" );header( "Cache-Control: no-cache, must-revalidate" );header( "Expires: Sat, 26 Jul 1997 05:00:00 GMT" );header( "Content-disposition: inline; filename=\"".basename( $media )."\"" );readfile( "{$media}" );

    $media is the file path. Ok so this works, the music plays. BUT it waits till it has downloaded the entire song before it will start playing in the browser. Where as if I put the direct location of the song in my browser it will start playing the song immediatly AS it is downloading the rest of the file. So my question is how can I serve the mp3 so that it starts playing as soon as data starts being sent back to the browser? Thanks so much!

    • Like 2
  7. I have two arrays.

    Array(	[0] => Array		(			[0] => 04/13/2012		) 	[1] => Array		(			[0] => 04/14/2012		)) AND Array(	[0] => Array		(			[0] => 0			[1] => 0		) 	[1] => Array		(			[0] => 1			[1] => 0		)) 

    How can I merge the data so it will look like this...

    Array(	[0] => Array		(  			[0] => 04/13/2012			[1] => 0			[2] => 0		) 	[1] => Array		(			[0] => 04/14/2012			[1] => 1			[2] => 0		))

    Thankss any help is always appreciated!

×
×
  • Create New...