Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
| Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 9th, 2003, 11:11 PM
Registered User
 
Join Date: Aug 2003
Location: Kolkata, West Bengal, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cnilashis Send a message via Yahoo to cnilashis
Default problem with PHP - MYSQL in LINUX

HI
I'm having a problem using some php functions in LINUX machines.
I'm trying the "header" function to redirect my visitiors to a specific page & i want to generate the pages dynamically ,
using arguments (For ex. redir.php?img=1.jpg). It is working fine in Windows machine , but not in LINUX/UNIX .
It is giving me error that headers are already sent .
I don't know why it is happening. I tried many things like
(1) I checked the configuration file (Php.ini) . some of the configurations r like that :
************************************************** *************************************************
 arg_separator.input = "&"

 arg_separator.output = "&"

 output_buffering = off

************************************************** **************************************************
(2) i tried changing the code . As i was found that the argument isn't coming from the previous page.
The code i used there is :

*********************************** redir.php ************************************************** ***********
global $link;
if($link=="")
die("error................");
header("Location: $link");
************************************************** ************************************************** **********
now if a link is like that : redir.php?link=http://www.yahoo.com , then it should redirect the visitor to the YAHOO! ,
but it is working in Windows & not in LINUX.
In Windows , i saw this problem when the output_buffering is set to off. So i turned it on , & it is working fine in
windows, but in LINUX , the same problem persists. Using "ob_start() " function , i tuned this function on (manually).
I don't know how to solve this problem.

I'm also unable to use MYSQL database in LINUX . It is saying that the built in PHP functions for
mysql (like mysql_connect() etc.) are unknown functions. Can anybody please help me ?????????


please help me ............... :(

Thanking u

:) NILASHIS :)

http://www.geocities.com/cnilashis




nilashis chatterjee
  #2 (permalink)  
Old August 12th, 2003, 07:38 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Switzerland.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello,

to enable mysql functions, you normally have to install a different package named something like 'php-4.x.x-mysql-x.x.x.'.

for the header problem, if you are sure that you're not sending header's information before those lines, try to delete any whitespaces before the opening php tag. (Can sometimes be the problem)

In order to avoid your problem, the header function should always be called from the first top lines, after the logic that controls what to write to the header.

Check also that php, apache and dns resolve to the correct host name, (http://your.site.com)

HIH

dikkjo
  #3 (permalink)  
Old August 16th, 2003, 10:41 AM
Registered User
 
Join Date: Aug 2003
Location: Kolkata, West Bengal, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cnilashis Send a message via Yahoo to cnilashis
Default

Thanks dikkjo , MYSQL is almost working now. But i am still having some problem with Query strings.
I can't do like that :
http://....../show.php?id=1 ( For example , how can i do that ? can anybody tell me ?) , It is working in WIndows But not in LINUX.

nilashis chatterjee
  #4 (permalink)  
Old August 18th, 2003, 02:24 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Switzerland.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello,

I think you have to check the register_global directive in your php.ini file. Alternatively you can change all your code and use $_GET or $_POST to retrieve the value you need.

you should also read this:
http://www.php.net/manual/en/securit...terglobals.php

Bye


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Query Problem w/ PHP rdmapes PHP How-To 5 August 14th, 2010 12:55 AM
PHP/MySQL Subquery Problem gfackler MySQL 1 April 18th, 2007 11:31 PM
mysql & php connection problem. Manu Sharma PHP Databases 2 March 2nd, 2007 07:03 AM
problem in mysql php charset yoord BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 April 11th, 2005 03:40 AM
Problem moving php from linux to windows skn8956 Beginning PHP 1 July 9th, 2004 06:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.