Welcome Guest ( Log In | Register)



 
Closed TopicStart new topic
> Parse: Error Unexpected T_lnumber, php parse error when running script
electriic ink
post Dec 14 2005, 07:41 PM
Post #1


Incest is a game the whole family can play.
Group Icon

Group: [MODERATOR]
Posts: 1,232
Joined: 11-February 05
From: Heaven
Member No.: 3,709
myCENT:53.83



Hi. I've just created a php script. The main object of the script is to delete some old files and replace it with a new file with some new content, effectively moving the contents from one file to another.

These are the first 50 lines of the file:

CODE
<?

/* Calculate For The "A" Group - The Latest Games ID */

$a_B = 002;

while(file_exists("a_" . $a_B . ".dat")) {

$a_B++;

}

$new_page_contents = " <? $title = \"" . $_POST["new_name"] . "\"; include \"/home/cmatcme/public_html/header.php\"; echo = \"<h3>" . $_POST["new_name"] . "</h3> " . $_POST["new_desc"] . " <object> <embed src='" . $_POST["new_game_url"] . "'> </object> include \"/home/cmatcme/public_html/footer.php\"; ?> ";

$a_stream = fopen($a_B . ".cmat", "w+");
fwrite($a_stream, $new_page_contents);
fclose($a_stream);

/* Calculate For The "B" Group - The Group Of The Games UniQue Numbers */


$b_1 = file_get_contents("/home/cmatcme/public_html/games/b_1.dat");
$b_2 = file_get_contents("/home/cmatcme/public_html/games/b_2.dat");
$b_3 = file_get_contents("/home/cmatcme/public_html/games/b_3.dat");
$b_4 = file_get_contents("/home/cmatcme/public_html/games/b_4.dat");
$b_5 = file_get_contents("/home/cmatcme/public_html/games/b_5.dat");

unlink("/home/cmatcme/public_html/games/b_6.dat");

$b6_stream = fopen("/home/cmatcme/public_html/games/b_6.dat", "w+");
fwrite($6_stream, $b_1);
fclose($6_stream);

unlink("/home/cmatcme/public_html/games/b_5.dat");

$b5_stream = fopen("/home/cmatcme/public_html/games/b_5.dat", "w+");
fwrite($5_stream, $b_2);
fclose($5_stream);

unlink("/home/cmatcme/public_html/games/b_4.dat");

$b4_stream = fopen("/home/cmatcme/public_html/games/b_4.dat", "w+");
fwrite($4_stream, $b_3);
fclose($4_stream);

unlink("/home/cmatcme/public_html/games/b_3.dat");

$b3_stream = fopen("/home/cmatcme/public_html/games/b_3.dat", "w+");
fwrite($3_stream, $b_4);
fclose($3_stream);


Line 31 has been highlighed in red as that is where the error apparently is. This is the error:

QUOTE
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/cmatcme/public_html/games/XXXXX.cmat on line 31


That line is no different to any of the others surrounding it, so why that line?
Go to the top of the page
 
+Quote Post
rvalkass
post Dec 14 2005, 07:59 PM
Post #2


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,235
Joined: 28-May 05
From: Devon, England
Member No.: 7,593
Spam Patrol
myCENT:5.98



Are you sure that the file exists? If it doesn't then you've effectively got code which says: $b_4 =

It may seem simple, but it's often the simple things that people miss smile.gif

However, when I counted down I got the 31st line as the one which says:
CODE

fwrite($6_stream, $b_1);


I don't see anywhere in the code where you set a value for $6_stream, so you are creating a file with a blank name.

Just another thought. PHP is very temperamental.
Go to the top of the page
 
+Quote Post
electriic ink
post Dec 15 2005, 07:55 AM
Post #3


Incest is a game the whole family can play.
Group Icon

Group: [MODERATOR]
Posts: 1,232
Joined: 11-February 05
From: Heaven
Member No.: 3,709
myCENT:53.83



* Changes Code *

Oh yeah. smile.gif Makes you wonder how you can miss something like that even after trying to figure it out for about 1/2hr.

Thanks for your help, rvalkass!

/~* Locked

Go to the top of the page
 
+Quote Post
iGuest
post May 6 2008, 06:36 PM
Post #4


Hail Caesar!
*********************

Group: Members
Posts: 5,876
Joined: 21-September 07
Member No.: 50,369



Hope you can answer my question
Parse: Error Unexpected T_lnumber

I have an annoying php problem. I am a Newbie and cannot sleep because of this.

Parse error: parse error, unexpected T_LNUMBER

Below is the php script:


<?PHP
//Modify your data in this section
//----------------------------------------------------------------------------------
$username = "goddy"; // Admin username
$password = "kennel"; // Admin password
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------

//First, define the modules you want to be displayed : Google, Yahoo, Amazon and the number of news displayed
$show_google = "1"; // Show google ads ?
$show_yahoo ="0"; //Show yahoo ads? WARNING : Be sure not to have both show_google and show_yahoo enabled
$show_amazon = "1"; // Show Amazon feed ?
$_numResults ="5"; // Number of news displayed in each page
$_linksResults = "5"; // Number of links on links pages
$use_privacy_policy = "1"; // Enable privacy policy page?
$use_terms_of_service = "1"; // Enable TOS page?
$use_contact_page = "1"; // Enable contact page?
$use_top_links = "1"; // Enable links page?
$use_products = "1"; // Enable recommended products?
$use_image_rotation = "1"; // Enable image rotation?

//-----------------------------------------------------------------------------------

// Configuration of your local installation and personal site definitions
$templatefoldername="includes"; //folder where templates are installed relative to the DocumentRoot.
$mysitename = "biggydaddy"; //name for your site
$mainkeyword = "biggydaddy"; //primary site keyword

//-----------------------------------------------------------------------------------

// your personnal affiliate ID in the following programs
$adsense_pub = "pub-56156429875626"; //your adsense publisher code
$adsense_channel = ""; // adsense channel
$yahoo_pub =""; // your Yahoo Publisher code YPN
$yahoo_channel=""; // your Yahoo channel
$Aassociates_id=array(
'uk' => 'INVALID' , // <-- replace INVALID with your amazon.Co.Uk associate ID
'us' => 'some-20' ,// <-- replace INVALID with your amazon.Com associate ID
);
$num_amazon = "5"; //Max number of amazon products to return
//-------------------------------------------------------------------------------------

?>

-reply by Julien
Go to the top of the page
 
+Quote Post
iGuest
post May 7 2008, 03:40 AM
Post #5


Hail Caesar!
*********************

Group: Members
Posts: 5,876
Joined: 21-September 07
Member No.: 50,369



Did I do something wrong?
Parse: Error Unexpected T_lnumber

I sent an question and no one replied to me. Did I do something wrong by posting a question about my problem? or do you take a long time to answer the posts?

Thanks.. Just tired of trying to get my site up


Below is the php script:


<?PHP
//Modify your data in this section
//----------------------------------------------------------------------------------
$username = "goddy"; // Admin username
$password = "kennel"; // Admin password
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------

//First, define the modules you want to be displayed : Google, Yahoo, Amazon and the number of news displayed
$show_google = "1"; // Show google ads ?
$show_yahoo ="0"; //Show yahoo ads? WARNING : Be sure not to have both show_google and show_yahoo enabled
$show_amazon = "1"; // Show Amazon feed ?
$_numResults ="5"; // Number of news displayed in each page
$_linksResults = "5"; // Number of links on links pages
$use_privacy_policy = "1"; // Enable privacy policy page?
$use_terms_of_service = "1"; // Enable TOS page?
$use_contact_page = "1"; // Enable contact page?
$use_top_links = "1"; // Enable links page?
$use_products = "1"; // Enable recommended products?
$use_image_rotation = "1"; // Enable image rotation?

//-----------------------------------------------------------------------------------

// Configuration of your local installation and personal site definitions
$templatefoldername="includes"; //folder where templates are installed relative to the DocumentRoot.
$mysitename = "biggydaddy"; //name for your site
$mainkeyword = "biggydaddy"; //primary site keyword

//-----------------------------------------------------------------------------------

// your personnal affiliate ID in the following programs
$adsense_pub = "pub-56156429875626"; //your adsense publisher code
$adsense_channel = ""; // adsense channel
$yahoo_pub =""; // your Yahoo Publisher code YPN
$yahoo_channel=""; // your Yahoo channel
$Aassociates_id=array(
'uk' => 'INVALID' , // <-- replace INVALID with your amazon.Co.Uk associate ID
'us' => 'some-20' ,// <-- replace INVALID with your amazon.Com associate ID
);
$num_amazon = "5"; //Max number of amazon products to return
//-------------------------------------------------------------------------------------

?>


-question by jULIEN
Go to the top of the page
 
+Quote Post

Closed TopicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Many Php Script Sites(16)
  2. Script: Php Jukebox(6)
  3. Transfer Variables To Another Php Script(9)
  4. Watermark Your Image With Simple Php Script(35)
  5. Free Auction Script(6)
  6. Wappy Buddy V1.10 - Tibia Gold Edition By Wappy & Jon Roig(3)
  7. What Kind Of Script Do You Need ?(15)
  8. Creatting A Playlist Through Php(5)
  9. Very Simple Online Now Script(4)
  10. Html Code Tester. Online Script(15)
  11. Php Downloads Script(4)
  12. Script Help Required: Undefined Variable(3)
  13. Library Script(6)
  14. How Would I Go About Making A Simple "counting" Script?(3)
  15. Forum Script(3)
  1. Php Rediret Script(12)
  2. Download Script For Mp3 Files(0)
  3. How Do I Connect To Live Database With Php Script?(6)
  4. Need Help Installing Dolphin Community Script!(5)
  5. Unexpected T_variable...(3)
  6. Unexpected T_string In User.php [resolved](5)
  7. Mysql Error(3)
  8. Guessing Php Script(2)
  9. How To Make A View New Post Script?(5)
  10. Php Guest Online Script(3)
  11. How To Make Php Newsletter Script(3)
  12. Linux/ Apache /mod_rewrite Issue(4)
  13. Getting Php Error On Oscommerce(3)


 



- Lo-Fi Version Time is now: 21st November 2008 - 11:00 PM