[Solved] I moved a wordpress website to my server and the home page shows up but why not any other pages? [closed]

[ad_1] We dont know about your setup but there are 3 things that can cause this. Goto settings> permalink and click on “Save Settings” If the above doesn’t work goto wp-config and add define(‘WP_HOME’, ‘http://example.com’); define(‘WP_SITEURL’, ‘http://example.com’); Check your .htaccess for base directory path, if your site is in a subdirectory you should replace it … Read more

[Solved] How to make a text box change depending on a dropdown menu

[ad_1] This code shows how you can accomplish what you seek. As others have mentioned, it’s not exactly the most secure / efficient way to do this, especially if you’re dealing with real money, but all you have to do to get this to work is add jquery to your html file with <script src=”http://code.jquery.com/jquery-latest.min.js”></script> … Read more

[Solved] Nearest next even hour

[ad_1] To accomplish your goal, you could add the missing time to your DateTime object: $dt = new DateTime(‘2014-11-08 22:05:00’); $sec = $dt->format(‘G’) * 3600 + $dt->format(‘i’) * 60 + $dt->format(‘s’); $sec %= 7200; $dt->modify(“-$sec second”)->modify(‘+2 hour’); echo $dt->format(‘c’); demo Be careful about DST. [ad_2] solved Nearest next even hour

[Solved] I need help getting the grand total of a simple php cart using sessions [closed]

[ad_1] Just replace this chunk of code, with my code below….should work… <?php //Print all the items in the shopping cart $totalAll = 0; foreach ($_SESSION[‘SHOPPING_CART’] as $itemNumber => $item) { $totalAll = $totalAll + ($item[‘qty’]*$item[‘price’]); ?> <tr id=”item<?php echo $itemNumber; ?>”> <td height=”41″><a href=”https://stackoverflow.com/questions/17129590/?remove=<?php echo $itemNumber; ?>”>Remove Item</a></td> <td><?php echo $item[‘name’]; ?></td> <td>£<?php echo … Read more

[Solved] Regex to split string into array of numbers and characters using PHP

[ad_1] Use this regex :(?<=[()\/*+-])(?=[0-9()])|(?<=[0-9()])(?=[()\/*+-]) It will match every position between a digit or a parenthesis and a operator or a parenthesis.(?<=[()\/*+-])(?=[0-9()]) matches the position with a parenthesis or an operator at the left and a digit or parenthesis at the right(?<=[0-9()])(?=[()\/*+-]) is the same but with left and right reversed. Demo here 5 [ad_2] … Read more

[Solved] Foreach go up by 1 php

[ad_1] Start the loop at the $ac0->result and then all the properties will be found in the $obj or whatever you like to call it in the foreach loop foreach ($ac0->result as $idx => $obj) { echo “From Array $idx <br>”; echo $obj->name . “<br>”; echo $obj->status . “<br>”; // etc } 2 [ad_2] solved … Read more

[Solved] Get Simple Facebook Profile Data Via PHP SDK [closed]

[ad_1] -Download SDK from developers.facebook.com and upload the folder “Facebook” on your web space; -Create a Facebook application; -Put this code in the same folder of “Facebook”: <?php session_start(); require_once(‘Facebook/Entities/AccessToken.php’); require_once( ‘Facebook/FacebookSession.php’ ); require_once( ‘Facebook/FacebookRedirectLoginHelper.php’ ); require_once(‘Facebook/HttpClients/FacebookHttpable.php’); require_once(‘Facebook/HttpClients/FacebookCurl.php’); require_once(‘Facebook/HttpClients/FacebookCurlHttpClient.php’); require_once( ‘Facebook/FacebookRequest.php’ ); require_once( ‘Facebook/FacebookResponse.php’ ); require_once( ‘Facebook/FacebookSDKException.php’ ); require_once( ‘Facebook/FacebookRequestException.php’ ); require_once( ‘Facebook/FacebookAuthorizationException.php’ ); require_once( … Read more

[Solved] Codeigniter – Using codeigniter email library, how do i send the email to a database list?

[ad_1] There is no native mapping of db table to email, so you have to first select, then retrieve then send $query = $this->db->query(“SELECT emailAddress from table”); //select email addresses $sendTo=array(); foreach ($query->result() as $row) //loop to build array { $sendTo[]=$row->emailAddress; //add to array } $this->email->to($sendTo);//send email Of course I have had to guess you … Read more

[Solved] PHP sql query isn’t returning anything

[ad_1] From the manual: Identifiers may begin with a digit but unless quoted may not consist solely of digits. http://dev.mysql.com/doc/refman/5.1/en/identifiers.html Which is exactly what you’re doing, and should not be doing. Solution: Choose a different name for your table, one consisting of letters preferably. Use backticks around the table name. Plus, if you wish to … Read more

[Solved] create html list from array with levels

[ad_1] If you need list with ul, li tags, try to use this code. It should work. $lastLvl = 1; echo ‘<ul>’; foreach ($array as $object) { if ($object->lvl < $lastLvl) { for ($i = 1; $i <= ($lastLvl – $object->lvl); $i++) echo ‘</ul>’; } if ($object->lvl > $lastLvl) { for ($i = 1; $i … Read more

[Solved] php include function leaves my page blank [closed]

[ad_1] Here: First file: (index.php I presume?) <div id=”navigation”> <?php include ‘menu.php’; ?> </div> <div id=”content”> <?php echo “Hello World!”; ?> </div> <div id=”footer”> <?php include ‘footer.php’; ?> </div> Menu: <?php echo ‘<ul> <li><a href=”https://stackoverflow.com/questions/23702104/index.php”>main</a></li> <li><a href=”info.php”>php info</a></li> <li><a href=”wda1.php”>Assignment 1</a></li> </ul>’; ?> Footer: <?php echo $filename=”https://stackoverflow.com/questions/23702104/index.php”; if (file_exists($filename)) { echo “This page was last … Read more

[Solved] How to add a checkbox value using php [closed]

[ad_1] Try this: <input name=”helicopter” type=”checkbox” value=”<?php echo $aircraft->helicopter; ?>” <?php if ($aircraft->helicopter==1) { echo “checked”; } ?>> [ad_2] solved How to add a checkbox value using php [closed]