php-windows Digest 27 Nov 2003 10:08:22 -0000 Issue 2018
Topics (messages 22212 through 22222):
Re: I keep getting parse error, unexpected T_VARIABLE
22212 by: Croskerry, Dan
Re: DFD for website
22213 by: Trystano.aol.com
22214 by: Croskerry, Dan
22215 by: Vail, Warren
Add user to Active Directory
22216 by: John
Redirection
22217 by: PETCOL
22218 by: Rasmus Lerdorf
22219 by: PETCOL
22220 by: Rasmus Lerdorf
22221 by: PETCOL
22222 by: Stuart
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
You are missing a quote line #11 >> date("H)
-----Original Message-----
From: Stephen Knight [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 12:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] I keep getting parse error, unexpected T_VARIABLE
I trying to figure out PHP, and have been reading several books. There
seems to be no ryhme or reason as to when to use single quotes or double
quotes. Here is the simple code that I am trying to get to work.
<html>
<head>
<title>Greetings</title>
<body>
<?php
if ($name) {
print ('Good');
if(date("A")=="AM") {
print ('morning,');
} elseif ( ( date("H") >=12) and
(date("H) < 18)) {
print ('afternoon');
} else {
print ('evening,');
}
print ("$name");
print ('!\n');
} else {
print ('Please log in.\n');
}
?>
</body>
</html>
I have made repeated changes, such as adding single quotes, etc... but I
still continue to get the parse error, Unexpected T_Variable.
--
In Kindness
Stephen K. Knight
www.fmwebschool.com
1-800-353-7950
Professional FileMaker Web Services
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
can I just point out that, being a student myself it is sometimes toooo time
consuming to wad through loads of books etc to find a problem, so posting a
question to the knowledgable ones is sometimes a better option, and much
quicker.
At the end of the day, we will learn the problem via both solutions.
Tryst
--- End Message ---
--- Begin Message ---
Hey Tryst,
It is nice when the questions are related to the theme of the discussion
board though is it not? (PHP in this case) That was the point that I was
trying to make. I guess I could have said it in a nicer way since I have
taken a ton of flak on this one today.
By the way, I'm sure those questions did not required wading through loads
of books. A couple simple queries on google would have probably done the
trick. Sorry if I offend anyone yet again but I think people are becoming
incredibly lazy in the pursuit of knowledge...
Dan
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 3:17 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] DFD for website
can I just point out that, being a student myself it is sometimes toooo time
consuming to wad through loads of books etc to find a problem, so posting a
question to the knowledgable ones is sometimes a better option, and much
quicker.
At the end of the day, we will learn the problem via both solutions.
Tryst
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Ok, here's my 2 cents worth.
It's hard to be off subject when it comes to PHP, since one of the primary
features of PHP is it integrates so robustly with a wide variety of internet
protocols, databases, other programming languages, etc.
Even design issues leave the new folks staggering from the possible
solutions, and most of them offering rapid development and implementation.
If bad design choices are made, you can rip out the bad code and replace it
with another option in the time it used to take to just get rolling.
To answer the original question, assuming that Rinku has not departed to
Antarctica to get away from being flamed, Data Flow Diagrams (DFDs) were
designed to help prevent long running projects from getting on the wrong
path early in the process and wasting lots of time and money. With the
rapid development available in PHP, you very seldom see these tools used any
more. If you are being asked to provide them, you are talking to someone
who has not seen systems that used to take a year to develop, being "slapped
together" (that's my technical term) in a month. To do DFD's in this
market, requires just too much time.
probably wasn't worth 2 cents, but what the hey,
Warren Vail
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 12:17 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] DFD for website
can I just point out that, being a student myself it is sometimes toooo time
consuming to wad through loads of books etc to find a problem, so posting a
question to the knowledgable ones is sometimes a better option, and much
quicker.
At the end of the day, we will learn the problem via both solutions.
Tryst
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hey all,
I'm trying to add a user to Active Directory with PHP. I'm running apache
1.3.29 and PHP (latest) on Windows 2000. I also have LDAPS working. I can
query AD, search it, even modify attributes for existing users, but the two
pieces of code I've tried don't seem to work. One is from the LDAP_ADD
portion of the PHP manual (site is down at the moment), and another is from
some guy's website which says to use LDAP_MOD_ADD.
Does someone know how to do this? If so, could you please share your code?
Also, how do you change a user's password in AD with PHP?
Thanks,
John
--- End Message ---
--- Begin Message ---
Newbie questions again.
In ColdFusion I'd use a <CFLOCATION> tag to push the user to another page or
location.......
In PHP I've read you can use a:
<?php
header("Location: http://domain/virtual/yourpage.php");
exit;
?>
However, when ever I've tried this I keep getting errors something like:
"Warning: Cannot modify header information - headers already sent by(page
I'm working on)"
Suggestions?
Col
--- End Message ---
--- Begin Message ---
You have to put this before any other output on the page.
-Rasmus
On Thu, 27 Nov 2003, PETCOL wrote:
> Newbie questions again.
>
> In ColdFusion I'd use a <CFLOCATION> tag to push the user to another page or
> location.......
>
> In PHP I've read you can use a:
>
> <?php
> header("Location: http://domain/virtual/yourpage.php");
> exit;
> ?>
>
> However, when ever I've tried this I keep getting errors something like:
> "Warning: Cannot modify header information - headers already sent by(page
> I'm working on)"
>
> Suggestions?
>
> Col
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Rasmus,
Thanks, but, what if, I've just gone through an set variables and outputed
the contents of those to PHP, just to run up a SQL query, to authenticate a
user. Set another to say they are authenticated, then I want to take the
user to another page? What PHP method would I use in this case.
Col
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> You have to put this before any other output on the page.
>
> -Rasmus
>
> On Thu, 27 Nov 2003, PETCOL wrote:
>
> > Newbie questions again.
> >
> > In ColdFusion I'd use a <CFLOCATION> tag to push the user to another
page or
> > location.......
> >
> > In PHP I've read you can use a:
> >
> > <?php
> > header("Location: http://domain/virtual/yourpage.php");
> > exit;
> > ?>
> >
> > However, when ever I've tried this I keep getting errors something like:
> > "Warning: Cannot modify header information - headers already sent
by(page
> > I'm working on)"
> >
> > Suggestions?
> >
> > Col
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
--- End Message ---
--- Begin Message ---
On Thu, 27 Nov 2003, PETCOL wrote:
> Thanks, but, what if, I've just gone through an set variables and outputed
> the contents of those to PHP, just to run up a SQL query, to authenticate a
> user. Set another to say they are authenticated, then I want to take the
> user to another page? What PHP method would I use in this case.
If you output anything to the user you can no longer do an HTTP redirect
by the very definition of how things work. You could do a Javascript
timed redirect, but if you output something for the user to see are you
really going to suddenly change the page on them without giving them a
chance to read it? Normally that is considered very bad UI design.
-Rasmus
--- End Message ---
--- Begin Message ---
Rasmus,
Thank you, sorted it out:
In the
<header>
<script language="javascript1.2">
function browserRedirect()
{
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
if(ns4) URLStr = "http://www.php.net";
else if(ns6) URLStr = "http://www.php.net";
else if(ie4) URLStr = "http://www.php.net";
else URLStr = "http://www.php.net";
location = URLStr;
}
</script>
</header>
In the
<body>
echo "<script language='javascript'>\n";
echo "browserRedirect()\n";
echo "</script>\n";
exit();
</body>
You might have a better cleaner suggestion?
Col
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thu, 27 Nov 2003, PETCOL wrote:
> > Thanks, but, what if, I've just gone through an set variables and
outputed
> > the contents of those to PHP, just to run up a SQL query, to
authenticate a
> > user. Set another to say they are authenticated, then I want to take
the
> > user to another page? What PHP method would I use in this case.
>
> If you output anything to the user you can no longer do an HTTP redirect
> by the very definition of how things work. You could do a Javascript
> timed redirect, but if you output something for the user to see are you
> really going to suddenly change the page on them without giving them a
> chance to read it? Normally that is considered very bad UI design.
>
> -Rasmus
--- End Message ---
--- Begin Message ---
PETCOL wrote:
<header>
<script language="javascript1.2">
function browserRedirect()
{
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
if(ns4) URLStr = "http://www.php.net";
else if(ns6) URLStr = "http://www.php.net";
else if(ie4) URLStr = "http://www.php.net";
else URLStr = "http://www.php.net";
location = URLStr;
}
</script>
</header>
In the
<body>
echo "<script language='javascript'>\n";
echo "browserRedirect()\n";
echo "</script>\n";
exit();
</body>
You might have a better cleaner suggestion?
If you're going to go this way (which as Rasmus pointed out is generally
very bad UI design) you might find the following a lot cleaner...
<script language="javascript">
location.href = 'http://www.php.net/';
</script>
There is no reason to do any browser detection, especially if you don't
actually change anything based on what browser it thinks it is. The best
solution however would be to reorganise the script so it decides whether
to redirect before it outputs anything to the browser.
--
Stuart
--- End Message ---