Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by sunfighter

  1. A while loop has to have opening and closing curly brackets to define the action. echo "<ul>"; while($row = mysql_fetch_row($result)) { echo "<li>".$row['insect_science']."</li>"; echo "<li>".$row['insect_com']."</li>"; } echo "</ul>"; Or: echo "<ul>"; while($row = mysql_fetch_row($result)) { echo "<li>".$row['insect_science']." -- "; echo $row['insect_com']."</li>"; } echo "</ul>";
  2. This is just a guess, but this line: document.getElementById(imgid).src = xmlhttp.getElementsByTagName("avatarMedium"); Should look something more along these lines: document.getElementById(imgid).src = xmlhttp.responseText; I'm taking it that the return here is the image src.
  3. Your html form needs to look like this: <form id="frm" action="ajaxChat.php">
  4. Redirect the page. Your page is in php so use that, not js. <?php header( 'Location: http://mywebsitei.com/wp-content/uploads/12345.jpg' ) ; ?> And this is all the code you need in the page B. Why you don't just make http://mywebsitei.com/wp-content/uploads/12345.jpg Page B is my question.
  5. You should download the major browsers and check for yourself. Easy thing to do but time consuming. One good thing in your favor is that it validates as good code. One bad thing is it's HTML5 so there is a good chance it won't work in any IE under 9
  6. <? is not used anymore. Use the full correct method of starting php <?php
  7. This is not an easy task. You do need to give more time to what you means by Is it an alphabetical order of authors and are you committed to doing this in php only? Does view by category mean only Romance novels or alphabetical listing of the categorizes? Anyway the display is probably easier to do with a table. You echo out the table heading and css info. Here is how to get the info out of the array and into a row: <?php $category = $books[1]["category"]; $title = $books[1]["title"]; $author = $books[1]["author"]; $publisher = $books[1]["publisher"]; $price = $books[1]["price"]; $isbn = $books[1]["isbn"]; echo <<<EOD <tr> <td>$category</td> <td>$title</td> <td>$author</td> <td>$publisher</td> <td>$price</td> <td>$isbn</td> </tr> EOD; ?>
  8. Why don't you publish the process.php code using the '#' tag above? I'm not going to open a file I don't trust.
  9. I don't think you'll get an answer from me, but I did make the database and ran your code. It didn't run. Got this message back "Unknown column 'hh.clock_id' in 'where clause'"
  10. To solve the empty string problem place this in start of if statement: if(isset($_POST['submit'])) { $empty_name = ""; $empty_content = "";
  11. While I see you added the phone number to the evaluation and to $res = addUser($_POST['username'],$_POST['password'],$_POST['email'], $_POST['phone'],'test_3.php'); You have not added it to the function function addUser($user,$pass,$email,$site_url) Nor to the insert $sql = "INSERT INTO users (username,password,email,active,level_access,reg_date) VALUES ('".$user."','".$pass."','".$email."',0,2,'".$reg_date."')"; Have you added a column to the database for the phone number?
  12. I find $eventname in four places in your code $eventname = str_replace("", "", $row['eventname']); <a href='index.php?view=event&content=tips&ttid=$eventid' title ='$eventname' class=\"fancybox fancybox.iframe\" style=\"color:#104E8B;text-decoration: none; \" > <strong><font size='2' face='Segoe UI' >$eventname</font></strong> </a> <a href='index.php?view=event&content=speaker&ttid=$eventid' title ='$eventname' class='fancybox fancybox.iframe' >$showsl</a> The first, $eventname = str_replace("", "", $row['eventname']); is where $eventname is defined. The str_replace() doesn't do anything, but doesn't hurt either. Maybe from old code. Could be remove for easier understanding of code. $eventname = $row['eventname']; It's the second group that I think you should send the $eventname to the next file. I'd do this: change href='index.php?view=event&content=tips&ttid=$eventid' To this href='index.php?view=event&content=tips&ttid=$eventid&eventname=$eventname' and in index.php add this line $eventname = $_GET['eventname']; after the $SOME THING = $_GET['ttid'];
  13. I'm going to guess here. Your title says "Problem with paragraph tag" so try this in your CSS p { display: inline; } It will remove the line breaks that the <p> tag has and maybe fixes the problem.
  14. I would use something like '*' to seperate your questions so file looks like this: *HTML is...,Main markup language for web pages,Cross-site Security,Cleverly Structured Scripting,eXtremely Safe and Secure,*PHP...,General-purpose server-side scripting language,Cross-site Security,Processing Hypertext Products,Process HTML Prettily Then look up the php explode() function . The explode() function breaks a string into an array. http://www.w3schools.com/php/func_string_explode.asp
  15. FYI: $event_name is nowhere to be found in either submission and the first code comes to an abrupt end. There has to be a button or something to move from one page to another. Though your code does not show it, it looka like it comes from the dropdown in the second code. If yes try doing a simple GET add on to the url by adding '?subject=event_name'.
  16. OK I guess I don't know what you want. I see three drop down menus that you want populated, right? I don't know what you want in the top dropdown because it is blank. But think it's the state. Right? The second dropdown has 'select city' in it and I thought you needed to find the cities that came from the first dropdown choice. Which should be the state or as you call it statecode and that came from the first or top dropdown. Is that right? And then you want to get the market and put that in the select market dropdown, the third one. Is that right? And where (table and column) is that info and what is the city column needed for that extraction? I gave you the query to get the second dropdown information after the state was picked in the first. You say this don't work? Your not getting the city names?
  17. Of course I read it. It's true advise and it's all over the web. I would have spent my time working this out for newphpcoder if he didn't plaster it all over the web himself. I just have an aversion to people that do that without waiting for one form to yield an answer. He did this as fast as he could post pitting one form against another.
  18. You can do this a couple of ways: echo "<span style=\"color:red;\">Location: ". $row['Location'] . "</span><br>"; or make a CSS section and do this: echo "<span id=\"location\">Location: ". $row['Location'] . "</span><br>"; The \n is not needed in your code.
  19. Your query does not look healthy $str="SELECT citycode,cityname FROM city WHERE statecode IN ( SELECT statecode FROM city JOIN state ON city.statecode = $id)"; This is what I think you want $str="SELECT citycode, cityname FROM city WHERE statecode = $id"; And you should has something in your first dropdown. Yours is empty. And I would not use 'action' as the name of a function. I'm sure it's a reserved word, but too lasy to look it up. Try "get_select" instead.
  20. That's useful, how would you insert multiple items? I don't know. How would you do it?
  21. for($i = 0; $i < count($Items1); $i++) { $sql = "INSERT INTO stock_requisition ........... NEVER EVER do a query, update, delete, select or any thing to a database in a LOOP!!
  22. Found these on the web: 1. Use the program HTML Tidy with its word2000 option 2. Find & Replace in Word: use the find function to find italized text, then use replace with <em>^&</em>. Then use a word macro, or script in your favorite text editor, to replace all the 'smart' quotation marks, character encodings, etc. 3. Save as an RTF file in word, then use DocFrac to convert it to HTML. HTML Tidy can be found here: http://infohound.net/tidy/
  23. Have you altered the page? I don't see a blue bar.
  24. Check this reall good. I only did it on the fly and just a couple of numbers <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>The greatest page title ever</title> <script src="./lib/jquery-1.7.2.min.js" type="text/javascript"></script> <script type="text/javascript"> function calculate(myForm) { //document.getElementById('area').value = Number(document.getElementById('length').value); document.getElementById('area').value = Number(document.getElementById('length').value) * Number(document.getElementById('height').value); var interum = Number(document.getElementById('area').value) * Number(document.getElementById('priceperunit').value); document.getElementById('totalprice').value = Math.round(interum*100)/100 } </script> </head> <body> <form id="myForm"> length :<input type="text" id="length" /><br /> height :<input type="text" id="height" /><br /> price :<input type="text" id="priceperunit" /><br /> <input type="text" id="area" />area<br /> <input type="text" id="totalprice" />totalprice<br /> <input type="button" onclick="calculate('myForm')" /> </form> </body> </html>
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.