PHP
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Calculator Programming subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. General Coding and Design => Calculator Programming
PHP
Author Message
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 16 Jun 2006 04:07:14 pm    Post subject:

My php process some things but not all it seems. I've got it to work with apache 2.0.58 (i know its not the latest but whatever). I created a file with the phpinfo() command and when I went to the page at http://localhost/phpinfo.php I was able to see the information displayed. When I use this code:

<html>
<head>
<title>A Php script including HTML</title>
</head>
<body>http://www.mozilla.com/products/firefox/central.html
Getting Started
<b>
<?php
echo "Hello World!";
?>
</b>
</body>
</html>

It works I see Hello World, but when I use this code:

<?php
$testing; //declare without assigning
echo gettype($testing); // null
echo "<br>";
$testing = 5;
echo gettype($testing); // integer
echo "<br>";
$testing = "five";
echo gettype($testing); // string
echo "<br>";
$testing = 5.024;
echo gettype($testing); //double
echo "<br>";'
$testing = true;
echo gettype($testing); // boolean
echo "<br>";
$testing = array('apple', 'orange', 'pear');
echo gettype($testing); //array
echo "<br>";
?>

I should see

Null
integer
string
double
boolean
array

on the screen but all I get is a blank screen. Why is this? BTW I'm getting this code from a book a bought to learn apache php and mysql, also I don't have mysql installed.

Edited: Code corrected. Series of typos.


Last edited by Guest on 16 Jun 2006 05:33:36 pm; edited 1 time in total
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 16 Jun 2006 04:16:05 pm    Post subject:

um, shouldn't the php closing ?> be right after the php snippet?

Edit: what PHP version are you using?


Last edited by Guest on 16 Jun 2006 04:18:51 pm; edited 1 time in total
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 16 Jun 2006 04:18:01 pm    Post subject:

any errors?
Back to top
JoeImp
Enlightened


Active Member


Joined: 24 May 2003
Posts: 747

Posted: 16 Jun 2006 05:13:57 pm    Post subject:

Move to General Coding and Design?
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 16 Jun 2006 05:17:07 pm    Post subject:

that makes most sence.
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 16 Jun 2006 05:36:22 pm    Post subject:

c_plus_plus wrote:
um, shouldn't the php closing ?> be right after the php snippet?

Edit: what PHP version are you using?
[post="82405"]<{POST_SNAPBACK}>[/post]


I'm using the latest version of PHP. Also there are no errros in the code. I looked it over. Any help?
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 16 Jun 2006 05:56:00 pm    Post subject:

try simplifiying it ie. just:

<?php
$testing; //declare without assigning
echo gettype($testing); // null
?>
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 17 Jun 2006 10:42:58 am    Post subject:

c_plus_plus wrote:
try simplifiying it ie. just:

<?php
$testing; //declare without assigning
echo gettype($testing); // null
?>
[post="82430"]<{POST_SNAPBACK}>[/post]


Bravo C++ Bravo. Yes that works but why is it that it needs to be simplified? I don't know why this book is teaching me things that don't if fact work. Neutral Anyway I guess I'll have to make many simple blocks of php script within one document to get that whole thing to work. Its odd its like this, or is it suppose to be like this?
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 17 Jun 2006 01:30:58 pm    Post subject:

If there is an error in any programing the easiest way to debug it is to break it into smaller pieces. try adding more code until it doesn't work anymore and start from there.

Edit: spelling


Last edited by Guest on 17 Jun 2006 01:31:30 pm; edited 1 time in total
Back to top
Newbie


Bandwidth Hog


Joined: 23 Jan 2004
Posts: 2247

Posted: 17 Jun 2006 08:48:12 pm    Post subject:

I broke it into smaller pieces and the whole thing worked and I didn't change anything, why is that? The original btw still doesn't work but the new one does and its exactly the same code. I'm confused.
Back to top
c_plus_plus
My Face Hertz


Active Member


Joined: 30 Jan 2006
Posts: 575

Posted: 17 Jun 2006 09:01:58 pm    Post subject:

I don't know. Although I typicaly like to know why something works before using it. I would say in this situation that if It works, go with it.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
PHP
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement