Cannot Save Link That Have "http://"

Hello…

I hope someone can help me.

This is my problem:

  • I have a textField, when i fill it with: google.com

    then i save, it’s going well.

  • But when i fill with http://google.com

    i got some error:

    Forbidden

    You don’t have permission to access…

  • My website into premium hosting already.

Please help me.

Hi,

In my idea… just give dropdown for http,https,ftp or something else on your own and get text from next fields only

so finally you will get https://www.google.com

Thank you chandran, that’s good idea, i’m even using this script at beforeSave() function at my model




if($this->dl1080 != "")

{

	//jika depannya http

	$d80 = substr($this->dl1080,0,7);

	if($d80 == "http://")

	{

		$dp = substr_replace($this->dl1080,"",0,7);

		$this->dl1080 = "http://".$dp;

	}

				

	//jika depannya ftp

	$d802 = substr($this->dl1080,0,6);

	if($d80 == "ftp://")

	{

		$this->dl1080 = $this->dl1080;

	}

				

	//jika tidak ada depannya

	if($d80 != "http://" and $d802 != "ftp://")

	{

		$this->dl1080 = "http://".$this->dl1080;

	}

}

The weird is at my localhost (windows), everything going well even not using that script. But after i upload to my hosting, and try to fill one field with= http://google.com

“Forbidden You don’t have permission to access…” .

Fill without "http:// working". Really weird.

I asking to my hosting, they say: "I think the problem is at your config file, please check your config file again".

Any idea??

I think you need to give more information to get help. Like:

  • What are you doing with this textField content? Redirecting, storing somewhere, …?

  • When you get the Forbidden error? After submiting your form? …

Hello.

This is my _form.php:


<?php echo $form->textFieldRow($model,'link_fb',array('class'=>'span5','maxlength'=>355)); ?>

This my model at rule():


array('foto1, foto2, foto3, foto4, link_fb', 'length', 'max'=>355),

And this is my controller:


public function actionCreate()

{

	$model=new TblBarang;

	if(isset($_POST['TblBarang']))

	{

		$model->attributes=$_POST['TblBarang'];

		if($model->save())

		{

			Yii::app()->user->setFlash('success', '<strong>Congrat!</strong>');

			$this->redirect(array('view','id'=>$model->id));

		}

	}


	$this->render('create',array(

		'model'=>$model,

	));

}

And the data save into my database MySQL, name field:


link_fb | varchar(355) | null(yes)

Please tell me if you need something else. I hope you can help me.

Thank you.