Jump to content

mgs019

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by mgs019

  1. Hello? I am guessing I may need to use a php proxy page on the recipients server but this seems pretty complicated. Anyone know an easy way? Martin
  2. Where do $WYKESPASSWORD and $WYKESPASSWORD come from because you compare to them but I do not see how they become defined. Maybe this is the problem. Martin
  3. Try something like: $PTries = "UPDATE playerTries SET playerTries = playerTries +1 WHERE playerID IN ($tryscorers) mysql_query($PTries)
  4. I have a .php/sql information page on my server which I want people to be able to embed in their site. ideally they would just have to add a line or two of code and maybe a file or two to their site and my page will be displayed in an SEO friendly way. I.e. it will be visible in view source. The password thing is because I know that the easy way to do this is give a .php page with the sql database stuff in it. I think that my database would last about 3 seconds if I did this though. Does this make sense? Martin
  5. Hi, I am trying to embed the resulting html page from a php page on another server in a website. I want it to be hardcoded so search engines can find it so i will ideally use a <?php include ?> type thing. I have an ajax method which uses a http proxy php page to fetch the page and update a <div> and I know I could chop that up and skip the javascript bit. Is there an easy way to do this? I want the imported page to be processed rather than as php as there is an sql database query thing going on and I want to display the results on any old website without giving out my db password etc. Any ideas would be great. Thanks, Martin
  6. Hi, Easiest way to set the number of results is to use LIMIT x,y in the sql query where x is start point (from 0) and y is duration. You will have to put a page number variable and do a bit of maths but pretty simple. The variable is wrong before the mysql_num_rows. you have $query but your query is $sql. Martin
  7. Cheers, That worked great. I thought it would be something simple like that but I am a noob when it comes to ajax. Cheers again, Martin
  8. I was. But at the moment I am just trying to get anything to display. I had e.g. var col = document.forms.colour.value For several variables in the script which then add to the url. It works well in an iframe by changing the url using these variables. However it did not work so I thought if I simplified it a bit it would be easier to work out where it is going wrong. Then I can add details later. Martin
  9. Hi, This is driving me slightly round teh twist. I want to use an AJAX XMLhttprequest thingy to dynamically display diamond information in a webpage as the attributes change in hidden form elements controled by javascript sliders. I am using an iframe at teh moment but it clicks like mad and is irritating so this seems far better. However, I coied the code from the w3schools website and made a couple of very minor changes (the url) but it does not work!!! The js file is associated because firefox web developer tools lists it correctly. The relevent HTML code is: <div id="diadetails">Diamond details</div><input type="button" name="update" value="update" onmouseover="showUser()" /> Obviously the button is just to trigger it. The script is: var xmlHttpfunction showUser() { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="/includes/guideprice.php" url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("diadetails").innerHTML=xmlHttp.responseText } }function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } All that happens is that in internet explorer it says error on page at line ... char 1 object expected. It gives an error for every triggering. I just cannot figure out what object it wants. Any idea guys this is really driving me insane ??? :'( Thanks alot. Martin
  10. Hi, I have an excel document with around 1000 records which I want to insert in to an SQL database. Is there an easy way to do this? I know I must get the data in a regularised format and so on first but is there an easy set of php commands to take a file apart and turn it to sql. I thought maybe from a tab delimited file? I want to be able to update regularly as I get an updated spreadsheet every week so I wanted to make a page to delete all the records and then repopulate with the new version. What I do not want to do is enter 1000 records manually!!! Any help will be appreciated, Martin
  11. Hi, One comment is that I think you should use the comparison operator == not the assignment operator =. I tend to use if(str_len($whatever)<1){} because I have had funny results with == null and isset() Martin
  12. Have you tried checked="checked"; I know this works for selected="selected" so I assume it would for this too. Martin
  13. Hi, This continues from another thread. I have a webpage with dynamic content using javascript to vary form values and a javascript function to update the url of an iframe to calculate price info from a sql database. The problem withthis is the clicking noise of internet explorer and the history and it is just a bit clunky. I would like a way to do this without these effects but did not know where to start. Someone mensioned updating a hash but I did not know what that meant. I guess I just want pointing in the right direction. I know I cannot call sql with javascript but is there something else I could use? Thanks, Martin.
  14. Hi, Thanks. The problem is that teh iframe contains a fairly lengthy php/sql thing to calculate a price. It is at blood-diamond.co.uk in the choose a diamond page where you see guide price. Is it possible to use a javascript update with that. At the moment there is a simple script which reads form values and updates the url of the iframe when the script is triggered by value changes. Am a bit of a beginner to javascript. What did you mean by updating the hash? I don't care about history. (in fact I would prefer no history). Thanks, Martin
  15. Hi, Still baffled! Any ideas guys? Thanks, Martin ???
  16. For interest I still could not get it t owork properly so used an Iframe with a script to change teh src dependant on the form values. That worked well. Martin
  17. Hi, I have a small javascript function which updates the url for an iframe as a slider is moved. In firefox it is beautiful. HOWEVER, in MSIE7 every time the url is submitted it clicks very irritatingly. Is there any way to suppress this annoying noise? Thanks, Martin.
  18. thats what I thought but it did not work. Unless there is something really silly I am missing in the syntax. i had: var x=document.forms.diamond.colour.value document.write(x) but nothing. If i put quotes around the 'x' it wrote x! I am thinking of going to plan B with this so I thought if I used text fields with a transparent border then I need to translate from the id to the colour/clarity and maybe a description. I thought something like: var coldesc var colnum=document.forms.diamond.colour.value switch(colnum) case 1 document.forms.diamond.colourtext.value="D - Pure white..." case 2... then an onload in the body tag. Will this work and how should the syntax be for the head script? I am ok with php but I am a bit of a JS noobie. Thanks, Martin
  19. I started a thread on this before but it got a little side tracked. I have a form where I have a select element with numbered values which relate to diamond colours and clarities. So 1=D, 2=E etc. I also have sliders from the Yahoo UI library which work great. I want to have the value displayed but not as a select. I tried disabled="yes" and it stopped passing the variable through. It seems to work for alert but not document.write!?!?!? My backup plan was to use a readonly textbox with a white border so it would not show up and use javascript to process the variables so something like var colname var colnum = document.forms.diamond.colour.value; if(colnum=1) colname=D ... in the head as a function, then put an onchange in the inputs. any chance of a bit of help in the formatting for the function, particularly the if or maybe switch part? Thanks alot, Martin
  20. Glad I could help, anyway to get back to my problem: I have a form where I have a select element with numbered values which relate to diamond colours and clarities. So 1=D, 2=E etc. I also have sliders from the Yahoo UI library which work great. I want to have the value displayed but not as a select. I tried disabled="yes" and it stopped passing th evariable through. It seems to work for alert but not document.write!?!?!? My backup plan was to use a readonly textbox with a white border so it would not show up and use javascript to process the variables so something like var colname var colnum = document.forms.diamond.colour.value; if(colnum=1) colname=D ... in the head as a function, then put an onchange in the inputs. any chance of a bit of help in the formatting for the function, particularly the if or maybe switch part? Thanks alot, Martin
  21. I still think the problem is that you are submitting the form when you do not want to. But you are still submitting the form by pressing the button. Try changing the button ftom type="submit" to type="button". Whatis the overall goal in this? The $_SERVER is a command that detects the page url. so the form gets the values and submits to itself. The problem is that it does not use them. The thing to do is to either change the action to a second page which will process the $_GET variables. Or, at the top of the page before the <HTML tag> put something to process the page. The other way is to put a line of php in the form to say <option value="2" <?php if($_GET['theme'] == 2) echo ' selected="selected"'; ?>>Animal</option> this will then keep the value selected that is passed back to the page. the only thing is that you have to do this lots of times but hey thats what copy/paste's for. Martin
  22. I would: 1) Make maps with grid references. 2) make an sql database with however many coordinates something like: id, resource, resource_description, mapid, x-coord, y-coord Then you can reference each item so for your example you would search for printer 23-541 and the result would be map=3 coordinate=(32,53) If you want to make it really easy use the image of the map as a background image and a bit of css to put a star or something at the coordinate with position:absolute; left:x-coord*factor; top:y-coord*factor; something like that should do. Martin
  23. I've got It (I think). You cant have an action and an onclick because the action will win (and reload your page giving you all again). Best bet is to add a button as type="button" not submit. and onclick="... Martin
  24. Hi, 1) your action says<?= should it be <?php ? 2) try removing selected="selected"
  25. I have this one working I think. I have a value change from a mouseover but my script is just onmouseover="document.forms.myform.myselect.value='myvalue'" You can set value to one thing and display text to another too. I don't know why it is going back to "all" though. Do you have another script pulling it back? Martin
×
×
  • 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.