Web Design Forums

PHP

Have questions about PHP? Ask them here and our experts will assist you before you know it! You can also find help in the documentation at PHP.net.

Wierd PHP -- Compilation Bug??



Site of the Month Nominations
ENTER YOUR SITE NOW!

Reply
 
LinkBack Thread Tools
Old June 21 '09, 02:53 PM (#1)
Danny[MLWA] is offline
WDF Regular
 
Danny[MLWA]'s Avatar
 
Join Date: June 2009
Location: Goldsboro, North Carolina, USA
Posts: 109
Danny[MLWA] is on a distinguished road
Wierd PHP -- Compilation Bug??

I ran into this problem yestarday and just wondering if this is the new version of PHP or if it is something as simple as a buggy compile...

PHP Code:
Line 1$var1="testval"//This is the first test val
Line 2$var2="testval"//This is the second test val
Line 3$var3="testval"//This is the third test val 
Would not run past line 2. After banging my head over this for hours, Ir emoved the comments, and it worked perfectly... It is like you can't do in-line comments like that any longer after the line break " ; " =(.

index.php:
PHP Code:
<?php
require_once('functions.php');
echo 
test_function("This is a test");
?>
functions.php:
PHP Code:
<?php
function test_function($test)
{
return 
$test
}
?>
This first of all displays an error on the page... "The constant PHP could not be defined, assuming "PHP". Oh yeah gets better...

Undefined function "test_function".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 21 '09, 04:22 PM (#2)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
i have tried several times to create and use functions with very little to no predictable results. i get an error every time. and yes i have followed the manual and a lot of other tutorials out there but function and class is about useless. the examples i see that could work, take more code then it would take just coding to order.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 21 '09, 05:07 PM (#3)
filburt1 is offline
bored
 
filburt1's Avatar
 
Join Date: July 2002
Location: Maryland, US
Posts: 11,785
filburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to all
Lowercase <?php, not <?PHP.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 21 '09, 06:16 PM (#4)
Danny[MLWA] is offline
WDF Regular
 
Danny[MLWA]'s Avatar
 
Join Date: June 2009
Location: Goldsboro, North Carolina, USA
Posts: 109
Danny[MLWA] is on a distinguished road
Quote:
Originally Posted by filburt1
Lowercase <?php, not <?PHP.
Yeah man, it was lowercase -- I'm sure of that. It was even bugging out on the functions and comments... basically if the line had a comment in it (//) it wouldn't even parse the entire line... so $var = "var"; // $var would remain undefined.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 11:00 AM (#5)
filburt1 is offline
bored
 
filburt1's Avatar
 
Join Date: July 2002
Location: Maryland, US
Posts: 11,785
filburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to all
There's no way a comment could affect the code like that. You may want to attach the files rather than copy/paste.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 11:09 AM (#6)
Danny[MLWA] is offline
WDF Regular
 
Danny[MLWA]'s Avatar
 
Join Date: June 2009
Location: Goldsboro, North Carolina, USA
Posts: 109
Danny[MLWA] is on a distinguished road
Its the wierdest thing I've ever seen... Recompiled... did the same thing... recompiled again, did the same thing... Deleted all of the files from my office pc, redownloaded all of the files from the server again, opened them in the editor, and it looked like this:

Code:
<?php include('config.php'); // Get the config file define("DB_HOST", 'localhost'); // Leave it at localhost ...................
Everything was on one line like the FTP transfer or something was removing all of the returns...

Switching the FTP transfer from "auto" to ascii, it worked fine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 01:07 PM (#7)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
lol why are you using ftp?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 01:19 PM (#8)
Wired is online now
WDF Alien Overlord
 
Wired's Avatar
 
Join Date: April 2003
Posts: 6,421
Wired is just really niceWired is just really niceWired is just really niceWired is just really nice
Send a message via AIM to Wired
Why is that lol? How would you recommend getting files to a web server?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 01:25 PM (#9)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,401
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
Danny,
Just curious what FTP program you're using.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 02:16 PM (#10)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
my apologies wired. i just have a dif view of how to get things done sir. images go through form upload and code gets cut and paste into the new file. i dont need to reset permissions, dont have to rename its already named and no chance of overwriting, less security risk.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 02:24 PM (#11)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
ok keeping in mind not every project is a 500page site with 100 flash animations.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 02:51 PM (#12)
filburt1 is offline
bored
 
filburt1's Avatar
 
Join Date: July 2002
Location: Maryland, US
Posts: 11,785
filburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to all
Quote:
Originally Posted by Wired
Why is that lol? How would you recommend getting files to a web server?
Not applicable to most users, but here every site we put live is just a working copy of an SVN repository. We haven't needed to FTP things for our sites in years, although most of our clients give us big files via FTP (either their server or ours).

I have no idea why FTP ever had those two modes (binary and ASCII). Why everything isn't just in binary and preserving the linebreaks is beyond me. Who cares if the file you get from a server has different linebreaks in it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 03:50 PM (#13)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
hey fil can you give a link to some svn info or start a thread on it. i could use a laymen breakdown. also it is useful info to all i think from what i saw when i googled it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 22 '09, 04:46 PM (#14)
Danny[MLWA] is offline
WDF Regular
 
Danny[MLWA]'s Avatar
 
Join Date: June 2009
Location: Goldsboro, North Carolina, USA
Posts: 109
Danny[MLWA] is on a distinguished road
Quote:
Originally Posted by mlseim
Danny,
Just curious what FTP program you're using.
FileZilla

We're still using ftp on client's sites... basically just a small development site that the devs can all FTP into. We're just using it for File-Transfer only right now -- not too worried about versioning yet =) .

Quote:
hey fil can you give a link to some svn info or start a thread on it. i could use a laymen breakdown. also it is useful info to all i think from what i saw when i googled it.
Google has the best repository I've seen and second to it is Source Forge... But I think SF still has that little clause that they can "charge" you or shut down your repository if you don't develop open source software (haven't read their rules in ages so don't bite my head off if they've changed it =P ).

Basically you get that setup and then winCVS set up the server details in it, and you're pretty much walking in the park.

Last edited by Danny[MLWA]; June 22 '09 at 04:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 23 '09, 03:29 AM (#15)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
thx danny
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 24 '09, 02:47 AM (#16)
aburningflame is offline
WDF Regular
 
aburningflame's Avatar
 
Join Date: December 2008
Posts: 477
aburningflame has a spectacular aura aboutaburningflame has a spectacular aura aboutaburningflame has a spectacular aura about
Theres nothing wrong with using an FTP client

anyways, the compilation bug has nothing to do with your PHP I ran into this problem many times in college.

I use Filezilla as my FTP client and Filezilla sometimes puts everything on 1 line, its very inconsistent. Once everything is on 1 line, the parser blows up.

This is NOT a php compilation bug, this is a bug in Filezilla that screws up the data transfer.

Update filezilla. If it still happens try toggling the transfer mode.
If it still happens, change FTP clients or setup a local php dev env.

Gluck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » PHP

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Top 21 PHP Programming mistakes thexchord PHP 19 June 18 '10 02:20 PM
PHP / Perl Coder Needed to Fix small Bug foodbiz Other Languages 12 March 17 '07 05:07 PM
ASP .Net --> PHP echoSwe PHP 4 November 6 '04 06:12 AM
php vs. cfm gar598 PHP 1 April 2 '04 12:49 PM
Basic PHP Uploads Tutorial thexchord Coding Articles & Tutorials 2 May 2 '02 08:28 PM

 
User Infomation
Your Avatar

Site Of The Month

Ticket Cake
Ticket Cake

Ticket Cake is a drupal based event ticketing platform. It features that ability to browse events and share them.

Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 02:31 AM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163