LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2011, 02:53 AM   #1
ShaqDiesel
Member
 
Registered: Jul 2005
Posts: 144

Rep: Reputation: 15
PHP script not being interpreted properly


I wrote a php script that was running fine as a standalone script. Now I am attaching it to a web form and it goes to the script, but the php is not being interpreted correctly, I have the php as:

<?php
code that is interpreted until object->variable
?>

The interpretation seems to stop after the '->' syntax. what is going on? Thanks.
 
Old 08-09-2011, 05:24 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Please post your real script fragment and real error message. If you have no errors visible, enable it by "error_reporting" and "display_errors" directives in php configuration file. Also check that on the server is the same version of php.
 
Old 08-09-2011, 08:12 AM   #3
ShaqDiesel
Member
 
Registered: Jul 2005
Posts: 144

Original Poster
Rep: Reputation: 15
<?php
$email = $_POST['email'];
$pw = $_POST['password'];
$date_start = $_POST['start_date'];
$connectionStr = "XXXXX";
if($mailbox = imap_open($connectionStr, $email, $pw))
{
echo "Connected\n";
}
$mail_check = imap_check($mailbox);
$msg_headers = imap_fetch_overview($mailbox, "1:{$mail_check->Nmsgs}",......

i looked at the page source in firefox and it looks like everything is interpreted(in pink) up to and including the -> sign. According to my apache/errors/error.log:
[Tue Aug 09 05:39:54 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/announce
As you can see I am doing this in localhost
 
Old 08-09-2011, 09:29 AM   #4
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Edit Nope, realised I misread that, your use of Nmsgs looks right and as per the example for imap_check and imap_fetch_overview... I'll ponder it some more.
To clarify, the examples and related docs:
http://php.net/manual/en/function.im...h-overview.php
http://www.php.net/manual/en/function.imap-check.php

So you're trying to reference(->) a valid object variable(Nmsgs) in the 1 to number of messages portion of the string you're building and passing to imap_fetch_overview().

The "File does not exist: C:/xampp/htdocs/announce" error seems unrelated.

Last edited by Proud; 08-09-2011 at 09:35 AM.
 
Old 08-09-2011, 10:36 AM   #5
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Quote:
it looks like everything is interpreted(in pink)
What does it mean - pink? Do you see your php code in the browser? You shouldn't. It would means that your server has no PHP installed or only files with .php extension are interpreted by it and you edited .html. You can parse html files too, by editing .htaccess file but it depends on server configuration, so you can ask admin.

Last edited by eSelix; 08-09-2011 at 10:39 AM.
 
Old 08-09-2011, 06:48 PM   #6
ShaqDiesel
Member
 
Registered: Jul 2005
Posts: 144

Original Poster
Rep: Reputation: 15
I figured it out, it was the fact that I didn't prepend my url with http://localhost.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Launch script to be interpreted on screen session? Super TWiT Linux - Software 1 02-16-2010 12:59 PM
Index.php (on Server) offered for download rather than being interpreted? AndreasM Linux - Server 2 01-19-2010 03:58 AM
PHP not interpreted by Apache in Red Hat linux enterprise 4 sohailkmu Linux - Newbie 8 02-02-2009 01:55 AM
LXer: Title: PHP/MySQL Classifieds Script AddAsset1.php Script Insertion LXer Syndicated Linux News 0 07-02-2006 06:21 PM
Php is not getting interpreted? swatward Programming 1 07-31-2005 03:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration