PHP - Moved: Order Of Calling The Js Files
This topic has been moved to JavaScript Help.
http://www.phpfreaks.com/forums/index.php?topic=328735.0 Similar TutorialsHi, i'm new to php and am trying to call $variables in different in multiple hierarchy from one main variable file. I have one main file called variables.php that contain a list of variables <?php $variable1 = 'root/main/'; $variable2 = 'welcome'; $variable3 = 'testing'; ?> a second file called file1.php in the same directory as the variables.php file <?php require 'varibles.php'; include $variable1 . 'testing.php' ?> a third file called testing.php inside root/main/ <?php echo $variable2; include $varible1 . 'temp/abc.php'; ?> a fourth file called abc.php inside root/main/temp <?php echo $variable3; ?> the problem is testing.php is able to echo $variable2 but abc.php is not able to echo $variable3...is there a limit to the level of files before it can't echo a variable? I have a user form with a dete button on a dropdown. When you click said button this runs function deleteUser(){ var e = event.target var uid = e.getAttribute("data-id"); console.log(e) console.log(uid) $.ajax({ type: 'post', data: {"ajax" : 'delUser', "id" : uid} }) } which goes into this if(isset($_POST['ajax'])){ switch($_POST['ajax']) { case 'newUserMod': exit(popNewUserModal()); break; case 'userMod': exit(popUserModal($_POST['id'])); break; case 'deleteUser': exit(deleteUser($_POST['id'])); break; } }; which calls this function in another file function deleteUser($id){ include 'includes/dbconn.php'; $stmt = $conn -> prepare("DELETE FROM user WHERE id = ?"); $stmt -> bind_param('i', $id); $stmt -> execute(); header('Location: manage-users'); } I know that i am getting the correct id in the ajax and i can see that the post happens correctly. Any ideas why the users are not being deleted? Hi, I have this php code to display the url of the files and it works fine, it just has a weird order when it is echoed out. Here is the code: Code: [Select] <?php $date = date("Y-m-d"); $picarray = array(); $handle = opendir ('pqimages/'.$date.'/'); while (false !== ($file = readdir($handle))) { if($file != "." && $file != "..") { $picarray[] = "http://randomaydesigns.com/pqimages/".$date."/".$file.""; } } $json_array = json_encode($picarray); echo $json_array; ?>There are three files in the folder and they are 33,34,35.jpg it displays them like 33,35,34.jpg Any Recommendations? Thanks, GEORGE how do i grab and print on page in date order all .jpg files in a folder ? This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=316624.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=318036.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=347726.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321790.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=355706.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=319167.0 This topic's house has been seized by the bank and it now lives in MySQL Help until it can get back on its feet. http://www.phpfreaks.com/forums/index.php?topic=358035.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=320026.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=326563.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=349226.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=309973.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=312690.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=354151.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=332593.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=321906.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=345631.0 |