Jump to content
php.lv forumi

Parse error


vingrotajs

Recommended Posts

Sveiki!


Man ir sanakusi tada problema ,kad es pats nezinu ko lai dara talak,varbut ir kads kas var man palidzet ?


Izbeigt sitas mocibas, tik tiesam nezinu ko tas nozime.


 


Parse error: syntax error, unexpected ':' in /home/a9712523/public_html/uploader.php on line 32


 


Paldies!


Link to comment
Share on other sites

Vai ir kads kas man var pateikt kas man te tiesi ir janomaina,jo es izmeginaju daudz ko ,bet nekaa nesanaaca :(

Parse error: syntax error, unexpected ':' in /home/a9712523/public_html/uploader.php on line 32

biju nomainijis uz : bet neka

 

 

  1. }
  2.  
  3. $file = $_REQUEST['file'] ?: 'images/'; <----- 32 linija ir seit , bet neko neredzu kas buutu jaizmaina.
  4.  
  5. $allowed = array('gif','png','jpg','JPG','csv');
  6.  
  7. if($_GET['do'] == 'list') {
  8. if (is_dir($file)) {
  9. $directory = $file;
  10. $result = array();
  11.  
  1.  
Link to comment
Share on other sites

kad nomainiju uz $file = $_REQUEST['file'] ? $_REQUEST['file'] : 'images/';

man uzmeta Parse error: syntax error, unexpected ':' in /home/a9712523/public_html/uploader.php on line 113

ko man dariit varbuut visu uploader.php failu jums ielikt lai kads vareetu noverst probleemu?

 

  1. }
  2.  
  3. function asBytes($ini_v) {
  4. $ini_v = trim($ini_v);
  5. $s = array('g'=> 1<<30, 'm' => 1<<20, 'k' => 1<<10);
  6. return intval($ini_v) * ($s[strtolower(substr($ini_v,-1))] ?: 1); <---- 113 atrodas seit!
  7. }
Link to comment
Share on other sites

Un ko tev tur tajā 113. rindā dara ternary operator (:?):

    return intval($ini_v) * ($s[strtolower(substr($ini_v,-1))] ?: 1);

... ja iepriekš jau tika teikts:

 

Visdrīzāk tev ir veca php versija un neatbalsta īso ternary pierakstu.

 

... un ar koda piemēru tāds jau tika tāds izlabots 32. rindā?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...