Skip to main content

Posts

Symfony routing is not working?

I am working on existing project. I have following two URLs http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/1/?hcid=147 http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/2/?hcid=147 2nd URL is working fine but 1st URL is giving me following error : Unable to find a matching route to generate url for params "array ( 'action' => 'showChapter', 'module' => 'course', 'courseowner' => 'myUserName', 'coursename' => 'myCourseName', 'courseid' => '150', 'chaptername' => 'myChapterName',)"., referer: http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/1/?hcid=147 I have following entry in routing.yml : course_chapter: url: /:sf_culture/course/:courseowner/:coursename/:courseid/:chaptername/:chapterid/:page/:pageid/ param: { module: course, action: showChapter }

pear.php.net is down. How to install mirror?

I was trying to install new packages in my PHP environment development via PEAR but as shown below: File http://pear.php.net:80/rest/p/packages.xml not valid (received: HTTP/1.1 404 Not Found) it seems that php.net is down. I tried to setup a mirror since us.php.net which Digg hosts with the following command: pear config-set preferred_mirror us.pear.php.net which gives the following error: Channel Mirror "us.pear.php.net" does not exist in your registry for channel "pear.php.net". Attempt to run "pear channel-update pear.php.net" if you believe this mirror should exist as you may have outdated channel information. Of course I can't update the channel since php.net is down. Does anyone know how i should proceed?

PHP: Merge/delete arrays with same subkeys

I'm writing a database class for my site based on a fluent interface. First, I collect all the meaningful terms then put them into the "stack", which is basically an array. Then, I sort them in order that they would appear in an actual SQL query. const stmt_select = 1; const stmt_insert = 2; const stmt_delete = 3; const sql_select = 10; const sql_from = 11; const sql_into = 12; const sql_where = 13; const sql_join = 14; const sql_group = 15; const sql_order = 16; const sql_limit = 17; For example, the query below (although in a total rubbish order, and purposely trying to throw the class off): Query::Select('name', 'age', 'height') ->Order('a') ->From('table') ->From('asd') ->Group('a') ->Execute(); .. produces: Array ( [0] => Array ( [0] => 10 [1] => Array ( [0] => name [1]

how to remote database mysql XAMPP from another computer?

the script of connection = <? $server = "192.168.0.167"; $username = "root"; $password = ""; $database = "dbbook"; mysql_connect($server,$username,$password) or die("Koneksi gagal"); mysql_select_db($database) or die("Database tidak bisa dibuka"); ?> and i had add this script on my.cnf file after [mysqld] = bind-address=192.168.0.167 but it didnt work with the following caption mycomputer.mshome.net is not allowed to connect to this Mysql server Please help me.How to remote database mysql XAMPP from another computer ?

joomla 1.7 user registration customization issue

-> i want to try new user registration customization. -> for that i create form and call hidden variable through function from controller. -> in controller save function i write this code but some function which not work in 1.7 so create problem here. function register_save() { global $mainframe; $db =& JFactory::getDBO(); // Check for request forgeries JRequest::checkToken() or jexit( 'Invalid Token' ); //clean request $post = JRequest::get( 'post' ); $post['username'] = JRequest::getVar('username', '', 'post', 'username'); $post['password'] = JRequest::getVar('password', '', 'post', 'string', JREQUEST_ALLOWRAW); $post['password2'] = JRequest::getVar('password2', '', 'post', 'string', JREQUEST_ALLOWRAW); // get the redirect $return = JURI::base(); // do a password safety check

how to write this in PHP [closed]

I have this function code from VB6 and want to write to PHP Function itung_part() rcrddet.MoveFirst total = 0 before = 0 road = 0 visit = 0 If rcrddet!Status = "Pending" Then pengali = 1 Select Case rcrddet!visit Case 0 kali_before = 1 kali_road = 0 kali_visit = 0 Case 1 kali_before = 0 kali_road = 1 kali_visit = 0 Case 2 kali_before = 0 kali_road = 1 kali_visit = 0 Case 3 kali_before = 0 kali_road = 0 kali_visit = 1 End Select Else pengali = 0 kali_before = 0 kali_road = 0 kali_visit = 0 End If awal = Format(rcrddet!DATE1, "mm/dd/yyyy") & " " & rcrddet!TIME1 rcrddet.MoveNext Do Until rcrddet.EOF akhir = Format(rcrddet!DATE1, "mm/dd/yyyy") & " " & rcrddet!TIME1 interval = DateDiff("n", awal, akhir) total = total + (pengali * interval) before = before + (kali_before * interval) road = road + (kali_road * interval) visit = visit + (kali_visit