[Solved] WordPress If Parent { } else if child { } [closed]

$sep = ‘ยป’; $parents = get_category_parents( $cat, TRUE, $sep ); $parents = explode( $sep, trim( $parents, $sep ) ); if( 1 === count( $parents ) ) { /* No category parents. */ require_once ( get_template_directory() . ‘/category-parent.php’ ); } else { /* One or more parent categories. */ require_once ( get_template_directory() . ‘/category-child.php’ ); } … Read more

[Solved] How to make login with userid or mobile number using php mysql [closed]

Change this; $query=mysql_query(“select * from users where userId=’$uname’ and pwd =’$pwd’ “); to: $query=mysql_query(“SELECT * FROM users WHERE pwd =’$pwd’ AND (userId = ‘$uname’ OR PhoneNum = ‘$uname’)”); What this does it will take both $uname value and search both Userid column and Phone Num column for a match. Please note that PhoneNum is the … Read more

[Solved] avoid php post variables rewriting [closed]

Your question is a little unclear, but if you’re trying to pass an array using a single form input the short answer is no, using a single element you cannot pass an array into the POST array (with the exception of the multi-select form element), but it’s easy with a tiny bit of processing once … Read more

[Solved] php How to save post and save show to php file like this [closed]

Without knowing your full requirements, this should get you started. I imagine you are going to want to store the saved/changed text into a database. If this is the case, you need to build upon what is provided below. Hope this helps. Enter Text Here… <?php if( isset( $_POST[‘my_text’], $_POST[‘save’] ) && strlen( $_POST[‘my_text’] ) … Read more

[Solved] i want to transfer data from column to another table column using PHP [duplicate]

Use this. here I use userId to select a particular row. you can alter it or not use it according to your requirement. $query = “SELECT amount FROM table1 WHERE userId='{$id}'”; $result = mysqli_query($con,$query); $sql = “UPDATE table2 SET total=”{$result}” WHERE userId='{$id}'”; mysqli_query($con,$sql); 0 solved i want to transfer data from column to another table … Read more

[Solved] Loop dirs and write xml of content files in php [closed]

If you want a flat iteration of a directory structure, try combining the RecursiveDirectoryIterator drived by RecursiveIteratorIterator. This is how the skeleton of the iteration could look like: $start_dir=”/some/path”; $rit = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $start_dir, FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS ), RecursiveIteratorIterator::SELF_FIRST ); foreach ($rit as $path => $fileinfo) { $level = $rit->getDepth(); if … Read more