344 Posted Topics
Re: Please keep in mind that this is just a [I]Notice[/I], not a fatal error. It's not actually stopping your program. Your script will continue running. If it's still not doing what you want, it means there's a logic error elsewhere in the script. All this Notice is doing is telling … | |
Re: Not a lot of time to write a full response now, but: These links should have variables at the end. Then based on the variables, you alter your WHERE and ORDER BY statements. So if the link is say [icode]http://www.yourdomain.com/page.php?filter=store&value=apple[/icode] [code=PHP] <?php if( isset($_GET['filter']) ) { $possible_filters = array('list','of','possible','filters'); // … ![]() | |
Re: [QUOTE=learner guy;1728359]i want to assign content of one div to another div ..lets say div 1 to div 2 just like in twitter when you type something and press "Tweet" a div is created and has the content of textbox .. how can i implement in php[/QUOTE] It's as pritaeas … | |
Re: Please use code-tags. No one likes reading code in plain text. | |
Re: Hi jabeen123, First a couple of points on syntax: a) You are missing a closing [icode]}[/icode]. You open one on line 2 and one on line 7, but only close one on line 11. b) You need quotation marks around the word [B]course[/B] in [icode]$_GET[course][/icode]. You may want to change … | |
![]() | Re: I agree with stoopkid. Since this is a [URL="http://en.wikipedia.org/wiki/Foreign_key"]foreign key[/URL] for a page ID, you should name it page_id. I would also recommend renaming the field called "comment" to "content" or "comment_content". Since your table is already called "comment", having a field with the same name might get confusing. Also, … |
Re: jelly46, can you show the HTML for the element with class [B]element-column-right-alpha-outer[/B], as well as the HTML and CSS for the element directly above/before it? | |
Re: I've never tried it before, but can't this be done easily with JS? Use AJAX to submit the form once, then either use a callback function to submit again, or let the form continue processing and go to the action page? EDIT: To be fair though I suppose using PHP … | |
Re: Hi Zero, Try adding this on line 30 (based on the complete code you added above): [code=PHP] <?php echo ( isset($_SESSION['username']) ) ? "Username is: $_SESSION['username']" : "Username not found!"; ?> [/code] Then let us know what this snippet outputs. | |
Re: Lacking your code to look at, I'd say refer to the bottom of [URL="http://apptools.com/phptools/forms/forms3.php"]this page[/URL]. The third-to-last block of blue text should give you your answer. | |
Re: How about using a counter in your loop? [code=PHP] <?php $i=1; while($i < 6) { echo "<input type=\"radio\" name=\"radio$i\" id=\"radio$i\" />"; $i++; } ?> [/code] | |
Re: Building on smantscheff's response, you'd also have an informative subject line instead of a vague plea for assistance, so I would know if I can help before I click the link. | |
Re: Out of curiosity, how do you plan to [QUOTE=abdulwajidck;1496228]customise the wordpress to maximum[/QUOTE] and [QUOTE=abdulwajidck;1496228]develop the site[/QUOTE] without programming knowledge? That's kind of the point, you need that knowledge to customize, or you need to pay someone who [i]has[/i] that knowledge to customize it for you. ![]() | |
Hi, I'm having trouble submitting a form using a link. I have a table that lists a bunch of data, and I want to allow users to edit the data directly in the table. The user can click the "EDIT" link, which makes jQuery replace the appropriate <td> html with … | |
Re: Just out of curiosity, why do you need the id in the URL still? I'm not sure about the tilde. Apache seems to use it to indicate user directories. | |
Hello, I am writing a development area for my clients to view their sites as I work on them. However, I'd like to restrict the directory of a given project to only users who are associated with that project. I'm looking for a way to create a "wrapper" so to … | |
Hello, I'm trying to create a button that allows the user to d/l info from a DB into a CSV. The button works fine, the download window appears and asks if I want to save/open the csv file. But when the file opens, there is nothing in it, and I … | |
Re: Are you sure there's no blank spaces before your opening <?php tag in either file? Even a single whitespace character (blank space, newline, tab) can throw this error. | |
Re: +1 almostbob. Also, thank you, james hank, for creating an account on this site solely for the purpose of 1) flaming a bunch of intelligent, knowledgeable folk kindly offering their excellent guidance, 2) providing misinformed, irrelevant advice, 3) reviving a thread that has been dead for a year and a … | |
Re: In jasha's code you need to replace [icode]'main.php'[/icode] with the name of the PHP file that you don't want directly accessed. Then put it at the top of your index.php. It [i]must[/i] go before any other output is sent. | |
Re: Good review. I'm sad to say it but I have to agree with you on a lot of points. Except in regards to ODST -- I thoroughly enjoyed ODST's campaign. True, it was a change of pace since you weren't as well-protected as the MC, but that's not necessarily a … | |
Re: Posting the code would help us diagnose the problem. For starters, though, you may want to make sure you're destroying the session. | |
Re: Yes, you would need to retrieve the ID from the table. To do this you can use [URL="http://us.php.net/manual/en/function.mysql-insert-id.php"][icode]mysql_insert_id()[/icode][/URL]. A couple of tips: [icode]session_start()[/icode] should be at the top of your script. If your table has 'id' set to AUTO_INCREMENT, you can re-write line 1 as [code=PHP] $query = "INSERT INTO … | |
Hi, I'm somewhat new to jQuery/JavaScript, so any help would be greatly appreciated. I have a few textboxes that need to be populated when a user clicks a hot spot on an image map. Each hot spot has an alt tag representing the ID number of the object I need … | |
Ok I feel like this may be a dumb question, but I'm putting it out there anyway. It's been a while since I've worked with C++. What characters does C++ print for negative values of char? Positive values seem to follow ASCII, but ASCII is only 128 characters. So where … | |
Re: My advice: Figure out what you want to do and look up a bunch of tutorials that do something like it, then put all the info together to accomplish your goal. | |
Re: You could store the user's ID in the [icode]$_SESSION[/icode] variable and then check if the user's ID matches the ID in the URL, and if not, redirect: [code=PHP] // Whenever you set your $_SESSION info, set: $_SESSION['user_id'] = $user_id; // Then, on page_name.php: session_start(); if($_SESSION['user_id'] != $_GET['ID']) // If the … | |
Hi all, I'm starting a new job soon and I'm going to be using my laptop there for a while until they get me my own system. I've set up a new user account called "Work" on my machine, but I'm not very well-versed with configuring user settings. What I'd … | |
Re: Did you mean line 11, not 111? The code should still run even with a warning -- is your output correct? | |
Re: Why do you have backticks around "admin", "Member", and "username"? I've never seen those used in a SQL statement, but maybe I'm just ignorant. In any case, try [code=PHP] $sql = "SELECT admin FROM Member WHERE username='{$_SESSION['username']}'"; [/code] and see if that works. | |
Re: [QUOTE=almostbob;1283986] php serverside javascript clientside nothing in php occurs after the page source is downloaded to the browser to change the page source after loading is done in javascript [/QUOTE] Well said, almostbob. Not to get off topic, but they should really sticky a thread about the difference between server-side … | |
Hi, I'm trying to make a link that changes my web page into a printable format and back: [code=HTML]<a id="print" href="#" title="Print map">Printable version</a>[/code] The switch to printable format works fine: [code=JavaScript] $('#print').click(function() { $('img').attr('src', newsrc); $(this).html('Screen version'); $(this).attr('id', 'screen'); return false; }); [/code] But going back, it doesn't work … | |
I have a rather embarrassing problem. While debugging a web app, I suddenly found I was not retrieving items from the database. I went to the command line to log into MySQL and got back "Error 1040: Too many connections." This was when I realized I'd forgotten to include a … | |
Hey all, I'm having a problem with my WordPress contact form. It is a script I edited from a tutorial I found, and it should be working right. I have a jQuery script that is supposed to help validate it and process it without page refresh. The problem is that … | |
Re: Here's one way to do it: [code=PHP] <?php if($_POST) { // create short variable names $name = htmlentities(trim($_POST['name'])); $email = htmlentities(trim($_POST['email'])); // process form } else { // create short variable names // they should have the same names as the ones created above $name = NULL; $email = NULL; … | |
Re: If you're constantly refreshing data with jQuery, you'd probably need jQuery to change the row colors. I'm no jQuery expert, but you could probably use some of the advanced jQuery selectors to accomplish this. [URL="http://api.jquery.com/gt-selector/"]:gt()[/URL] in particular may come in handy. You should be able to use this to add … ![]() | |
Re: On line two you are referencing the [icode]$_REQUEST[/icode] superglobal instead of the [icode]$row[/icode] variable. | |
Re: A word on usage: You should use $_POST for submitting forms, and $_GET when you need to redirect someone to a site an provide specific variable-value pairs. For example, if you have an e-commerce site, and your page loads product information from a database based on product ID numbers, you … | |
Re: If I'm understanding you correctly, you want the form to populate with data as soon as the user selects an item from the drop-down menu. There's two ways of doing this that I can think of, but either way requires JavaScript. Method 1: This method uses JS to go to … | |
Re: Because you have [icode]$num<=5[/icode]. It will run the loop again when [icode]$num = 5[/icode], so you get $num++, making [icode]$num[/icode] = 6. To cut off at 5, take the "=" out of the while condition. ![]() | |
Re: Most of the function keys are already reserved by the browser for other tasks. So if you assigned an action to, for example, the F5 key, you'll end up refreshing the browser window. It may be possible to stop the default behavior of the button -- I'm not sure. Regardless, … | |
Re: pssubash is right. One way is to include a hidden field and use that to get the value: [code=PHP] <input type="hidden" id="id_number" name="id_number" value="<?php echo $id; ?>" /> [/code] You would retrieve this with [icode]$_POST["id_number"][/icode], same as the other fields in your form. Alternatively, however, if you really want to … | |
![]() | Re: Did you draw a mock-up of your site first? This will help you figure out what you're trying to build. Once you have a mock-up built, I personally prefer to build my pages from the top down, although another alternative may be to build the overall frame of the page … |
Re: Just have it [code=PHP]echo "\r\n";[/code]Where it says // move to the next line | |
Re: You can make the links for your separate pages of results look like this: [code=PHP] <a href="mysite.php?page=1">Page 1</a> <a href="mysite.php?page=2">Page 2</a> [/code] Then when the page loads, before the DB query executes: [code=PHP] $RESULT_LIMIT = 20; // make sure $_GET['page'] is an integer if(!strcmp(gettype($_GET['page']), 'integer') { $page = $_GET['page']; $result_start … | |
Re: Change that last line to: [code=PHP]echo '<a href="'.$sample12.'">'.$sample12.'</a>[/code] See if that works. | |
Re: You need to use a function to extract the result array from the [icode]$result[/icode] resource. [I]If[/I] you are [B]only[/B] interested in the [B]first[/B] result you get from your query, you can just use this: [code=PHP]$row = mysql_fetch_array($result);[/code] EDIT: [icode]$row[/icode] will contain the first row of results returned by the database. … | |
Re: Hi, You're missing a semi-colon and an assignment operator in your first line (Also, why is there an opening brace right after it?): [code=PHP] $include_path = '/usr/lib/php:/usr/local/lib/php:/home/findthem/php'; { [/code] Hope that helps. -EF | |
The End.