- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- Interests
- C++
33 Posted Topics
Hello I need to filter data from database. Use selects the data he need from selectboxes and inputs. Not all inputs must be filled. Those that arent have value of -1. I have put together a SQL statement that should work. Probably would work without the prepare but I need … | |
Hello, Not really sure if this is the right place to post this to but I am pretty sure I need js to accomplish this. I need to make a dropdown selection menu for my wordpress theme options, but I can't use the conventional `<select>` tag because I want my … | |
Hello, I have a div that contains small posts, it grows automatically. When size is too big then the scrollbar apepars with CSS overflow property. What I want is that when more data is added then the div is automaticall scrolled down to it BUT when user decides to scroll … | |
Hello, I have a small problem with my script. The ajax calls php file but it wont finsih successfully. Instead it goes to error: callback. My javascript part: function updateUserlist(){ $.ajax({ type: "POST", url: "process.php", data: {"function": "userList", "n_users": n_users}, dataType: "json", success: function(data){ console.log("Updating..."); $("#users-list ul").append("<li>"+data.text['nickname']+"</li>"); n_users = data.numUsers; … | |
Hello, I made a class to connect with database but now I have run into a little problem. I need to get the id of last inserted row, but I dont know how to accomplish it. Here is my connection class: <?php class Connection{ public function __construct($config){ $this->mysqli = new … | |
Hello, I want to delete a user from database and destroy the session after he has been idle for some time, lets say 5 mins. How can I do that ? For starters, how to check if the user is idle? I need it mainly for when a user closes … | |
I want to check if nickname contains only numbers and letters. It cant contain anything else. My current code is not working because as soon as I type in atleast one legal lettrer, the entire string evaluates to true every time I check, no matter how many illegal characters it … | |
I have a weird problem. I try to add two strings together but instad the variable evaluates to 0. Why is this happening and how to fix it ? <?php require_once('config.php'); $connect->query("SELECT id, name FROM room"); $rooms = $connect->get(); print_r($rooms); $result = "<ul>"; $asd = "Test"; /* foreach($rooms as $room … | |
Hello, I am making a calculator for school and so far I have written a code that allows user to combine and input. Calling it a formula would be wrong I think. It's like User pushesh buttons and comes up with an input like this for example : 11+4+9-5. Now … | |
Hello, I have two requests to my server. The first one gets categories and the output to URL is something like this: doomain.com?category=1. The second request is meant for sorting the data in that specific category. This request outputs something like: domain.com?sort-by=name. What I need is something like this: domain.com?category=1&sort-by=name. … ![]() | |
Hello, I would like to know how to output potentally thousands of posts with pages. So that i can choose how many posts to display on a page and the ones that wont fit will note be generated there. instead on the bottom of the page there will appear links … | |
As you can see from the title I am interested in making a shopping cart with javascript. What it should do is allow a client to add/remove products from the cart. Increase the quantity and have a visual overview of his cart. When he is finished he would go to … | |
I have a content div that may very likely be shorter than sidebar div. They are both wraped in div with ID of "container". I need the content div to automatically change its height to be same tall as the sidebar. I included an image too. Regards | |
| |
Hello, I have a PHP page called summary.php and I m trying to make the jquery script to post piece of data when <select> is modified. This is my code atm [CODE=js] <script> $("select").change(function () { page_id=$(this).attr('id'); alert(page_id); $.post("#", {id:page_id}); }) .change(); </script> <?php if(isset($_POST['id'])){ die("YES!"); } echo $_POST['id']; ?> … | |
How to set seperate heights for <td> ? I have table with one rows and 2 cells. In one of them there is more data, so it drags the other cell longer than it should be and that's ugly. I need something that automatically adjusts the cell height according to … | |
Question in title. I need it for my PHP site to know which theme is active and I dont want to use database for it. I think it should be possible, cause wordpress doesnt have this stored in database either (I think). | |
Re: On line 31 remove ALL spaces or parenthesis to them Line 31 should look like this: [CODE=PHP]mysql_query("INSERT profiles SET 'employee no'='$employeeno', 'employee name'='$employeename', position='$position', salary='$salary', 'allottee name'='$allottee', address='$address', relation='$relation', age='$age'")[/CODE] | |
I have a function that changes slides, I have created a pause and resume functions for it, but when the user presses resume button multiple times, then multiple instances of the script is beeing run and the images change too fast. I need to prevent this from happening. This is … | |
Question it title, how to do it ? I need to stop a function with another function or I need to call a global function inner function with another global function so I could stop it that way. I know its possible but how ? ![]() | |
Hello, I need to submit a form as soon as selection has been changed and call PHP function. I know I can do this with onchange="this.form.submit(); but this will generate an url similar to this: [CODE=PHP]?submit_position=change[/CODE] while I need to generate something like this: [CODE=PHP]?p=edit-product.php&action=change_pos&id=$id[/CODE] This is what my form … | |
Hello, I need to get two get functions from url, but I cant get the second one, how can I do it ? Something like this: [CODE=PHP] <h4><a href='?p=edit-page.php?page=$id'>$title</a></h4> [/CODE] The p will include the edit-page.php in my container which is just list of page titles and when I click … | |
start_session() after <html> tags generates error, Can it be used there somehow? If so, then how ? If not then what are the alternatives cause I have a function that generates some part of my <head></head> in my themes. So the session_start() definately has to saty in that function (e.g … ![]() | |
Hello, I have a function which is registering a navigation menu [CODE=PHP] function register_menu($name, $displayname){ if(!is_menu()){ $menu['name'] = $name; $menu['displayname'] = $displayname; $registered = TRUE; //This should be global, so that is_menu() function can use it. } } [/CODE] And another function which checks if the menu is registered [CODE=PHP] … | |
Hello, I need a php code that can detect the root foldername that my website is installed to. I need to use this constant in my bootstrap.php so it can't be relative to where the file is called from. Atm I have my root folder and admin folder. I need … | |
Hello, How can I make a menu for the following code [CODE=HTML] <div id="sidebar"> <ul> <li><a href="#">Master link</a> <ul> <li><a href="#">Link to be revealed</a></li> </ul> </li> <li><a href="">Master Link 2</a> <ul> <li><a href="#">Sublink</a></li> </ul> </ul> </div> [/CODE] Wit this CSS, I m hiding the second level of the menu, that … | |
Hello, I would like to know how to call a theme in a custom made CMS. I have some very primitive bootstrapping done (I dont really know how to do it). I have finished the functions I need and I have actually finished the theme aswell, the only problem is … | |
Hello, I want to validate this form and display error right next to the input field. [code=html] <div id="regForm"> <form action="register.php" method="POST" onsubmit="return validate(this);"id=registration" name="registration"><p> Username: <input type="text" name="username" id="username_reg" /><br /> Password: <input type="password" name="password" id="password_reg" /><br /> Repeat password: <input type="password" name="repeatPassword" id="repeat_reg" /><br /> Email: <input type="text" … | |
I m not sure if thats right section, but I m pretty sure it's done with PHP. So the question is, how can I change a conetent inside a division without navigation to new page. For instance I have 4 division. Header, links, content, footer. Now if i click some … ![]() | |
Probably a stupid question but why does the following loop works ? There is nothing wrong with it I just want to understand how does this code know how many entries I have in database. [CODE=PHP] $result = mysql_query("SELECT * FROM post_categories"); while ($row = mysql_fetch_array($result)){ echo $row['Name']; } [/CODE] … | |
Hello, Is there any infinty sign to assign to a variable ? I need my program to check if the value of one variable is smaller than the other, but i cant do it cause if i dont set a value to my variable at the beginning of the program … | |
Hello, I m doing an exercise i found in internet. The exercise is the following: [QUOTE] Pancake Glutton Write a program that asks the user to enter the number of pancakes eaten for breakfast by 10 different people (Person 1, Person 2, ..., Person 10) Once the data has been … | |
Hello, this is kinda my first program. I would like to know how to clean the screen so only this code would stay in the console [CODE=C++] cout<<"Welcome to calculator!\n\n"; cout<<"[*] - a * b\n[/] - a / b\n[-] - a - b\n[+] - a + b\n\n";[/CODE] I m also … |
The End.