Jump to content
Sign in to follow this  
Sanitaars

Šī lapa nedarbojas

Recommended Posts

Sveik..

Man tāda problēma pirmo reiz..

man piem ir parasta html forma action="add_quiz.php"

beigās kad es visu esmu savadījis un spiežu pievienot viņš rāda šādu erroru-->http://prntscr.com/f5m67z

kods no add_quiz.php

<?php
extract($_POST);
include "../class/users.php";
$quiz=new users;
$qus=htmlentities($qus);
$option1=htmlentities($op1);
$option2=htmlentities($op2);
$option3=htmlentities($op3);
$option4=htmlentities($op4);
$array=[$option1,$option2,$option3,$option4];
$answer=htmlentities($ans);
$query="insert into questions (question,ans1,ans2,ans3,ans4,ans,image_url,cat_id)values ('$qus','$option1','$option2','$option3','$option4','$answer','$img_url','$cat')";
if($quiz->add_quiz($query))
{
	$quiz->url("index.php?msg=pievienots");
	
}

?>
  

error logs saka - [08-May-2017 23:55:06 Europe/Riga] PHP Parse error:  syntax error, unexpected '[' in /home/*****/public_html/tests/admin/add_quiz.php on line 10

Edited by Sanitaars

Share this post


Link to post
Share on other sites

Aizstāj 10. rindu ar

$array = array($option1, $option2, $option3, $option4);

 

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.