Jump to content

Jodha

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Jodha's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Solved! Funny what a cuppa tea and a fag break can achieve. I needed to add a row to my content table which refers to the form processing .php file. Next, the "action='...'" section needs to be (as I tried before adding the relevant row in my content table) action='index.php?action="the reference to the form processing file, as per content table"' With the amendment to the content table I have the functionality that I want
  2. Hi All, Been up to some interesting things, now got a website shell well on its way to fully communicating with its website db. Got a posting form question, hope you can help My 'page display' is thus: header at top; menu at left; content (as per navigation) on the right; footer at bottom. Currently I have some forms appearing in the 'content' area of my 'page display'. When I hit 'submit' on my form the processing script .php file replaces my entire (previously described) 'page display'. I.E. I loose header, menu and footer, and only see what I echo on the form processing .php file. On the "<form... action='.....'>" part of the start tag for my form, is there a way of making the form processing .php file appear in my content area (as oppose to replacing my whole 'page display')? I have tried various variations of link within the ''s of action='...', but to no avail. - this includes index.php?action='blah' Currently the 'page display' builds by constructing a table via echo, and in each cell in the table I am using an include ('xxx.php'); command to display the section I want. In the content area the section in the parenthesis is a variable, which allows different .php files to be loaded into my content section. This has been faultless using normal <a href...> type links. IE for "home" my URL = website/index.php?action=home for "add text" my URL = website/index.php?action=add_text But when I process the add text form the URL = website/"the directory the processing form is in"/add_text_exe.php Hmmm... any thoughts?
  3. Sorted: Below the query script I need to include the following - $row = mysqli_fetch_assoc($result); $max_'variable name' = $row[0]] echo $max_'variable name' I can now see my maximum variable number as $max_'variable name', thus can use $max_'variable name' is other parts of my code where I need to. I knew it would be quite simple in terms of some additional code with correct syntax after the initial query. I've now got this working to pull two max variable values out of my table The rest of my code should be easy now I have obtained two maximums I needed
  4. OK, I've looked at the link provided, it looks like it refers to something else I am already doing elsewhere which I am fine on. In MyphpAdmin I type this: SELECT MAX(column) FROM table I get my magic number 'X', I know the SQL query works. In my script I am currently trying: _________________________________________________________ $cnx = connections variables, all present and correct $query = "SELECT MAX(column) FROM table"; $result = mysqli_query($cnx.$query) or die ("die statement"); $row = mysqli_fetch_[ row/assoc/array - same output for any ]($result); echo $row _________________________________________________________ I echo $row so I can see if it agrees with the number I obtain from the direct SQL query typed into MyphpADMIN. All I see displayed is "Array". - Using the actual table column name as a variable displays nothing - Using the actual table column name without a $ displays the column name, not max number. __________________________________________________________ From other experiments I am pretty sure I can obtain the highest value in a column on a table, and just display it in a couple of code lines following the query. Using 'while' statements seem to be more relevant to when I am waling through the content of a table, displaying items from each row and I go through each row. I can do this aspect no probs Thoughts anybody?
  5. Cool, Actually a mate's just called with similar solution: code: $query = "SELECT MAX(column) FROM table"; $depth = myqsli($cnx,$query) or die ("die message"); But echo $depth; displays "Catchable fatal error: object of my class mysqli_result could not be converted to a string on 'line reference of code'" plus I am getting the same message which ever way I go about this now. Assuming highest value is '5' I could do with $depth = 5, or what ever it gets set to in the db...
  6. Hi! Assume I've queried a database and obtain values from column 'X'. This only contains numbers. Can I obtain a variable which will equal the highest number in that column? I can only find info on how to add all the column numbers, select rows for certain number values, or list all the column numbers, sorted or unsorted Quite happy with that, just want to be able to extract the highest number from the selection ??? Help muchly appreciated
  7. Hmmmm, handy tip. Good to see your sig amended too
  8. By the way Blade280891, sorry to be pedantic but in your signature it should be: "the other 0.1% means you asked the wrong question" You are out be one decimal point
  9. I thought so, my apologies there. Haven't had such probs to this degree with column widths when the page is HTML, so just thought there might be a little PHP trick involved there Maybe IE should be taken out Fight Club style, I figure this must be one of the most annoying aspects of webdev - your site looks cool on all browsers but the browser which happens to be shipped with the most used OS. Dam them MicroSoft peeps (sorry if thats you!)
  10. Hi, sorry if this is inappropriate to ask here, shoot me down if so I am using "echo" to display a table if which the left column MUST be 200 pixels wide, and no more for proper presentation. In my code I have: echo "<tr> <td width ='200' align='left' valign='top'>"; include(.....); echo "</td> <td>"; include(.....); echo "</td> </tr>"; (please excuse silly typos - reading from laptop and posting from desktop compys, plus food has just been dished up! In Firefox the left column width is 100% perfect In IE the column width seems to be ignored, and the browser just does what it wants, something its most of the page wide, sometimes just some. Does anybody know why IE behaves inconsistently and is there a trick to make it perform like Firefox? Cheers me mateys
  11. Hi GURAQTINVU, All problems solved (see other thread on same subject), further up the learning curve, and much happier Getting there Still a lot of other stuff to learn, but I now know enough to build my current site project. Once done, I can turn attention back to the books and get to grips with other aspects. Enjoying the learning, just get frustrated (maybe a little too easily) when what should be a simple answer doesn't show its self clearly... but that might be compounded by me not always knowing what I am actually looking for
  12. SUCCESS Applying the code which thorpe provided in the his last post has solved all my current problems with this site design. I can use my expanding menu, use the linking and variable value adjusting code as suggested, and my provisional template if giving my correct test results. All I need to do now is get the frick on with the job Thorpe, I am very grateful. If you where local I'd take you out for a pint. In absence of this, I hope this will do until a such time when I can buy you a pint:
  13. I am semi-familiar with $POST but not yet used $GET, there is a bunch of text the contraversally writing Janet Valade has in her book, I shall reread shortly. I'm well aware of case sensitivity, but thanks for the double check I like uniformity in code otherwise its easy to loose yourself innit!
  14. Errant_Shadow and thorpe, I do believe you have provided me with my holy grail, thank yee both very muchly Looks like I have both options to work with, so my day looks like I should get it rolling and get coding Thorpe, if I missed your previous reference it's probably because I have been looking out for <a href... and I dont think you have mentioned that in your previous post, you spoke of other code statements. I would imagine my lesser knowledge stops me from connecting the two. Sorry for making you type things out again, however, your second post is very clear to me. I take my hat off to you for that I also see your point about bookmarks, however I was more thinking about it from site security... if the viewer is getting less info on how you have your directories (etc) it'll be harder for them to hack. Although I suspect a serious hacker would still find it kids play. I normally like to produce sites so the navigation side of things means you dont 'have' to book mark a page as such, you just go to the site and all pages are so easy to get to you can ask the question, why bookmark this single page when it is one click from your menu? ...guess I'm not thinking as if I had a photo album with hundreds of sub pages however. Maybe I'll revise my practises. Anyways, many thanks again. Hopefully I'll not need come back for more help on this, but assuming wind is now in sail I'll let you know successful I've been Cheer!
  15. Hmmm, it will I'm sure, but I dont think I still have an answer to what I am actually trying to achieve right here right now. However, before saying any more I would like to thank everybody who has provided advice and guidance thus far. Now, let me try and provide a full rundown of my project, which should show why the good advice so far doesn't actually help me that much. Or at least, why I am not interpreting is correctly. 1) I want an index.php file which is the website portal. I've done this with HTML and framesets where the frameset is the portal. I dont like sites which fill the address bar with loads of stuff, I like to keep what it shows simple. I.E. "http://www.thewebsite.com". I find any "/index.php" or "/index.html" gets truncated the way I do this, which I also like. I think this may be browser dependent, but thats by the by 2) At the top I want a header. 3) On the left side I want the navigation function. My 'client' (friend in need to website) has specified a particular menu system I have in HTML code using CSS and JS. 4) To the right of the menu I want the content to be displayed. This changes as per menu item selection. 5) At the bottom I want the footer. My index.php (template) is currently coded thus: header.inc and footer.inc you dont need to know about. They contain details of my client's business and we are both satisfied with the way these display and their content. $content is a variable I wish to use for selecting what is displayed in the main part of the site. As the variable changes, different pages are displayed, (ahem) obviously! I know how I can combine aspects within a variable from other variables or just plain adding in extra bits of string to turn say $content = home to $content = home.inc or $content = content/home.inc etc. The issue is with these dam <a href=content.html>Content</a> aspects in the menu script. The menu script (disregarding the CSS and JS) looks like this: Now, what is the PHP statement which needs to follow "<a href=" to change this from a normal HTML link tag to a statement which changes the value of $content? That is my one and only question I want an answer to. I dont want links to websites where I have to wade through a bunch of text to try and find the answer, I've been doing this to no avail, which is WHY I come to a forum of PHP heads to directly ask people who know this language better than me. Lets assume somebody knows, please tell me Assuming there is no statement for this (I am happy to accept this as a possibility), the other way I figure I can do this is: - repeat the script I have already described but in a way which sections index.php into its (what will be about 50) sections of content and the <a href=content.html>Content</a> statements take you to each section. Something like - <a href=index.php?action=content>Content</a> Using this, for each section I'll use an "include(content.inc)" statement instead of the $content variable. Seems longer winded but I still get what I want. It'll mostly be a cut'n'paste operation anyway. For this option, I need to know two statements: 1) The statement which starts each block of code for each section 2) The statement which ends each block of code for each section I'm sorry if this has already been answered, but I cannot see the answer clearly in what has been returned so far if this is the case. As for connecting to a database, for the above I dont want to get into that. I will be using a database for displaying sections of content such as the CVs and the information guides my client needs to display on his site. I am already versed enough with such database interaction to achieve this happily -> one of my personal projects was building an events listing application for my website which is database driven, I've got it referencing flyer images and formatting dates, times and prices plus a "publish this event" option and an update information function. My stumbling blocks are taking my previously used library of HTML menus and implementing them in PHP script, similar to how I describe above. If no advice can be provided to answer this (hopefully simple issue) I'll just have to jump back to using framesets in HTML to get the site presentation how it has been briefed. Many thanks in advance for further help, I dearly hope somebody understands what I am trying to do and provides the right guidance. Best regards all
×
×
  • 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.