Jump to content

gish

Members
  • Posts

    92
  • Joined

  • Last visited

    Never

Everything posted by gish

  1. I got it to work but it sets the orientation back to default every time. header("Location:http://192.168.1.2/purefun/temp/temptransfere.php"); # this is so that orientation will change equations orientation if($_SESSION['datatransfere'] ['Orientation'] == 0){ $_SESSION['datatransfere'] ['Orientation'] = 1; }else{ $_SESSION['datatransfere'] ['Orientation'] = 0; } $_SESSION['datatransfere'] ['Progresstable']= $_SESSION['datatransfere'] ['Progresstable']+1; exit;
  2. I tried this an it comes up with an error Parse error: syntax error, unexpected T_STRING in /data/webpage/orientationtransfere.php on line 8 if($_SESSION['datatransfere'] ['Orientation'] == 0){ $_SESSION['datatransfere'] ['Orientation'] = 1 header("Location:temp.php"); }else{ $_SESSION['datatransfere'] ['Orientation'] = 0; header("Location:temp.php"); } $_SESSION['datatransfere'] ['Progresstable']= $_SESSION['datatransfere'] ['Progresstable']+1;
  3. hi everyone, all i want this to do is change the value and go back to the page that it came from. I am stuck. I can run the script but if i direct it back to the using an include statement say include temp.php it creates a loop and every time I press another a href it changes the orientation value and I don't want that to happen. it should only change when I press the code below. does any have any ideas. thanks gish a href="orientationtransfere.php" name="Orientation" if($_SESSION['datatransfere'] ['Orientation'] == 0){ $_SESSION['datatransfere'] ['Orientation'] = 1; }else{ $_SESSION['datatransfere'] ['Orientation'] = 0; } $_SESSION['datatransfere'] ['Progresstable']= $_SESSION['datatransfere'] ['Progresstable']+1 include "temp.php";
  4. Hi everyone I have a theory question. Is it possible to run two ajax scripts on the same page with out them affecting each other? Gish
  5. it was bad function call above
  6. The problem was the function was not been read by opera. the new formated script fix the issue // "document.body.clientWidth" and "document.body.clientHeight" var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } canvasX = myWidth; canvasY = myHeight; the script is a howto that has been modified by me gish
  7. The ajax is called when an animation reaches screen height
  8. hi everyone I have been doing ajax for a year now and with howto and examples I have put this script together and it has been running fine never an issue. but I download opera the other day and it will not work so is it written wrong. Can anyone see an issue. It will work in ie, firefox. function checkResult1() { if (request.readyState ==4) { var randomDiv = document.getElementById("randompic"); randomDiv.innerHTML = request.responseText; } } function getNewXMLHttpRequest() { var findbrowser; try { findbrowser = new ActiveXObject('Microsoft.XMLHTTP'); } catch(a) { try { findbrowser = new XMLHttpRequest(); } catch (a) { findbrowser = false; } } return findbrowser; } function getanewpicture() { request = new getNewXMLHttpRequest(); var url ="randompic.php"; request.open("GET", url, true); request.onreadystatechange = checkResult1; request.send(false); } Anyone got any ideas. gish
  9. Thankyou for your help, I have doing some reading I think I might change to object as that is more compliant. gish
  10. hi everyone I have got some javascript that works in every browser i have got except for opera. i don't think that this piece of code is working i debug with firebug and have looked at the opera error console and there are nothing wrong with a the script. getWindowCoords = (navigator.userAgent.toLowerCase().indexOf('opera')>0||navigator.appVersion.toLowerCase().indexOf('safari')!=-1)?function() { canvasX = window.innerWidth; canvasY = window.innerHeight; }:function() { canvasX = document.documentElement.clientWidth||document.body.clientWidth||document.body.scrollWidth; canvasY = document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight; } The code has to work so that it can resize and reposition buttons for ajax. The buttons and ajax work fine. Does anyone have any suggestion why it won't work. Gish
  11. hi everyone i am running apache2 server at home (that is on the internet). My problem is this all php scripts except this one is working. The email account does exist and this is the entire script. I place it on the web server and then run it. It tells me that it is sent but I never get an email. Any direction would be helpful? <?php // Your email address $email = "me@gmail.com"; // The subject $subject = "Enter your subject here"; // The message $message = "Enter your message here"; mail($email, $subject, $message, "From: $email"); echo "The email has been sent."; ?> gish
  12. gish

    load picture

    ok i keep getting this error 'document.getElementbyid[]'is null or not an object' I have googled it and get a lot of unnecessary information. The code that i have change is the following. pic1 = document.getElementById('button1').getElementsByTagName('img')[0]; Gishaust
  13. gish

    load picture

    Thankyou for the answer, and for the direction.
  14. hi everyone, I have been teaching myself javascript and have been doing ok but this script is not working and I am sure that it is some thing simple. I need another set of eyes just to read it. If you see the the issue I would be very happy for any information. The image is supposed to load where i want it too. <head> <title>Untitled</title> <style type="text/css"> <!-- .pics1 img { position:absolute; width:45px; height:45px; } --> </style> <style type="text/javascript"> <!-- var canvasX = 0; var canvasY = 0; function init(){ getWindowCoords(); loadimages(); } getWindowCoords = (navigator.userAgent.toLowerCase().indexOf('opera')>0||navigator.appVersion.toLowerCase().indexOf('safari')!=-1)?function() { canvasX = window.innerWidth; canvasY = window.innerHeight; }:function() { canvasX = document.documentElement.clientWidth||document.body.clientWidth||document.body.scrollWidth; canvasY = document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight; } function loadimages(){ var picsx = canvasX/4; var picsy = canvasy/2; pic1 = document.getElementById('button1').getElementsByTagName('img'); pic1.style.left = picsx+"px"; pic1.style.top = picsy+"px"; } window.onresize = getWindowCoords; window.onload = init; --> </style> </head> <body> <div id="button1" class="pics1"> <img src="but1.gif" alt=""> </div> </body> </html> gishaust
  15. [!--quoteo(post=378185:date=May 29 2006, 02:44 PM:name=ale_jrb)--][div class=\'quotetop\']QUOTE(ale_jrb @ May 29 2006, 02:44 PM) [snapback]378185[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code] <html> <head> <title>Favourite Fruit</title> </head> <body> <p><strong>Question 1:</strong> What is your favourite fruit? <p><FORM method="POST" action="<?php echo $_SERVER['PHP_SELF']?>"> <input type="radio" name="fruit" value="Apple" checked />Apple<br> <input type="radio" name="fruit" value="Banana" />Banana<br> <input type="radio" name="fruit" value="Grape" />Grape<br> <input type="radio" name="fruit" value="Orange" />Orange<br> <INPUT TYPE="SUBMIT" value="Send data"> </body> </html> [/code] Did you mean to do something like this? This asks that user their favourite fruit. They choose one of the options and click "Send" and it stores their answer in a text file. Is that what you were trying to do? [/quote] this is exactly what i was looking for. but this raises an issiue when you use a submit button does the submit button gather all the in information with in the form and then send it the server. witth this code <FORM method="POST" action="<?php echo $_SERVER['PHP_SELF']?>"> if so when it sends how do I manipulte it. not sure how this works "<?php echo $_SERVER['PHP_SELF']?> Iam sure that it is very easy when you know now
  16. [!--quoteo(post=378004:date=May 29 2006, 02:16 AM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ May 29 2006, 02:16 AM) [snapback]378004[/snapback][/div][div class=\'quotemain\'][!--quotec--] I can't understand what is your problem. You don't need the $Question1 variable in there. Besides, the string is enclosed by single quotes, so it's not interpolated what means $Question1 would actually do nothing. Also, there is no such thing in HTML like value= something = "1". Simply value="1" is enough, assuming you just want to know the user's choice. [/quote] It sounds like i am trying to hard. if I am on the same wave lenght all i the number is suficent enough. so when it gets submited it reads the valued that is selected by the user. Then I have grab that info and send it. I am sorry poirot as I said I am only a beginner.
  17. It is official I am going nuts I am a beginner i php5. I got on the net and down loaded a lot of information. after reading the info. I decided to start forms. That easy enough. I can email it myself without a problem. The I decided that I would write to a text file on the apache2 server. I found some code of the net and that was easy enough. if you are writing text. put for three months I have been trying to get this php code to write its self to a text file on the server. I am sure at it is very easy. In the <head> I have been trying to get the variable $question to change value and then write and I cannot do it please can anyone help. Or even a tut that will break it down step by step P.s. the next step for me I though was Mysql but i have been reading that mysql would be adquate for a beginner is this true does anyone have an opinion. Sorry P.S Is there a newsletter I can subscribe to for beginners in php <html> <head> <title>Sample</title> </head> <body> <FORM method="POST" action="<?php echo $_SERVER['PHP_SELF']?>"> <?php echo '<input type="radio" name="gender" value= $Question1 = "1" checked />1 unsure<br>'; echo '<input type="radio" name="gender" value= $Question1 = "2" />2 Thats true<br>'; echo '<input type="radio" name="gender" value= $Question1 = "3" />3 I never thought<br>'; echo '<input type="radio" name="gender" value= $Question1 = "4" />4 Nice one<br>'; ?> <INPUT TYPE="SUBMIT" value="Send data"> </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.