Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 25th Apr 2012, 09:57 AM   #1
Active Warrior
 
PHPSpaZ's Avatar
 
Join Date: 2012
Location: Madisonville, Tennessee
Posts: 52
Thanks: 21
Thanked 0 Times in 0 Posts
Default
Question with fwrite
Share on: 
fb share twitter share gplus share more share

I have a need to generate pages from a back-end GUI. The pages however need to have php in them, this includes various if/else clauses and db connections. I tried to do this with fwrite but even though the functions were in quotes it still made the page that was writing the file throw an error as soon as it hit the first bit of php.

My question is can I write the php to a template file and make fwrite fill in the spaces between when it generates the page or is there another function that will allow me to do this.

Doing what I can to help those I can -Me
PHPSpaZ is offline  
Unread 25th Apr 2012, 12:10 PM   #2
HyperActive Warrior
War Room Member
 
Join Date: 2004
Location: , , .
Posts: 179
Thanks: 5
Thanked 44 Times in 33 Posts
Default
Re: Question with fwrite
Share on: 
fb share twitter share gplus share more share

If the error occurs when you are attempting to write '<?php ', try splitting it into something like '<' . '?' . 'php '

fwrite($fp, '<' . '?' . 'php '); instead of fwrite($fp, '<?php ');
phpg is offline  
Unread 25th Apr 2012, 01:02 PM   #3
HyperActive Warrior
War Room Member
 
Earnie Boyd's Avatar
 
Join Date: 2012
Posts: 290
Thanks: 13
Thanked 46 Times in 46 Posts
Default
Re: Question with fwrite
Share on: 
fb share twitter share gplus share more share

Make sure to use a single quote ' character and not a double " character and if you need to output a single quote ' character use a backslash \ character to quote the quote.

Earnie Boyd is offline  
Unread 25th Apr 2012, 07:01 PM   #4
Active Warrior
 
PHPSpaZ's Avatar
 
Join Date: 2012
Location: Madisonville, Tennessee
Posts: 52
Thanks: 21
Thanked 0 Times in 0 Posts
Default
Re: Question with fwrite
Share on: 
fb share twitter share gplus share more share

Thanks guys, I think I got it now.

Doing what I can to help those I can -Me
PHPSpaZ is offline  
Closed Thread


Bookmarks

Tags
fwrite, question


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 12:09 AM.