RichardRotterdam
Members-
Posts
1,509 -
Joined
-
Last visited
Everything posted by RichardRotterdam
-
[SOLVED] What should i be looking for?
RichardRotterdam replied to Modernvox's topic in PHP Coding Help
Do you happen to store your passwords in a ftp client? If so it could be that some virus is stealing those passwords from it. Try a virus scan on the computers you use for uploading files to your webserver. -
[SOLVED] JavaScript to check java installed or not
RichardRotterdam replied to Basit's topic in Javascript Help
http://lmgtfy.com/?q=javascript+check+java+installed -
Server changes and object iteration issues.
RichardRotterdam replied to pthurmond's topic in Frameworks
I notice 2 foreach loops <?php foreach($questions_answers AS $qa): foreach ($qa->answers AS $a): endforeach; endforeach; Now which one wont run? And what is the output of(if its simple enough to show as code and not a load of 2 pages): echo "<pre>",print_r($questions_answers),"</pre>"; -
Indeed where do you get this information? I like PHP-CLI and I use it quite often.
-
Just wanted to add a little thing. The following code could result into invalid HTML since you are able to set the id "selected" twice. window.onload = function() { var liNodes; liNodes = document.getElementsByTagName("li"); for(i = 0; i < liNodes.length; i++){ if(liNodes[i].className == "subCat"){ liNodes[i].onclick = setSubCatActive(this); } } } function setSubCatActive(target){ target.setAttribute("id","selected") } In HTML this could result into the following: <ul > <li class="subCat" id="selected">item1</li> <li class="subCat" id="selected">item2</li> <li>item3</li> <li>item4</li> </ul> This is not something you would want since the ids should always be unique. Instead why not add a second class? You can add multiple classes to an element. that would look like <li class="subCat selected">item1</li><!-- two classes here--> This is how a jQuery translation would look like(read the comments for explanation): <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> // wait till the dom is loaded $(document).ready(function(){ // fetch all list elements with class subCat var liElements = $('#jquery_list li.subCat'); // set click event for all li elements with class subCat liElements.click(function(){ // add extra class "selected" to the li element $(this).addClass( "selected"); }); }); </script> <!-- I added the id jquery_list here so possible other li elements will be uneffected. It's just a little prevention of posible conflicting code. --> <ul id="jquery_list"> <li class="subCat">item1</li> <li class="subCat">item2</li> <li>item3</li> <li>item4</li> </ul>
-
While I had a pretty good experience with Xampp under Windows I don't like it much under Linux it had too many bugs for me. I recommend not using lampp but installing mysql Apache and php with synaptic instead if you can. It will be a lot easier to manage upgrade and addons especially if you want to run other stuff such as python and ruby on Apache. I don't think your php.ini file for php cli is located in your lampp directory. Try doing a scan and search if you have more then just the two php.ini files you mentioned.
-
Not sure if this is the case with your Linux distro but I have two php.ini files (or more not sure at the moment since I am not behind my own PC). There is a php.ini for the webserver and a php.ini for the php-cli. What distro of Linux are you running? And do you have more then one php.ini file? The paths could look like: /etc/php/php.ini /etc/php-cli/php.ini The include_path seems right but the error does not seem to verify this. That error would indicate that you have a include path like: include_path = ".:/usr/share/php/libzend-framework-php/"
-
Hmmm don't know how to solve those warnings I haven't experienced anything like that before as I am fairly fresh with Linux myself (6 months). Maybe you should ask that in the Linux forum. As for the fatal error. In your php.ini file , what does your include_path setting look like? I suspect that you're including the Zend Framework twice somehow.
-
running php-cli and php under apache(or any other webserver software) are different. You need to install the php-cli.
-
Hmm just typing zf in the terminal should work. You said you received the following error 44: php: not found Maybe you can't run php in the terminal. what happens if you type php in the terminal?
-
how are you running the file? Are you using a terminal under linux?
-
somthing like this maybe? <script type="text/javascript"> window.onload = function(){ // call your fade out script here } </script>
-
[SOLVED] Controlling Javascript with php???
RichardRotterdam replied to craigtolputt's topic in PHP Coding Help
Hmmm i think you don't really understand what the code does. the following code <?php $displayStatus = (isset($_POST['contactus']))?"block":"none"; equals: <?php $displayStatus = ""; if (isset($_POST['contactus'])){ $displayStatus = "block"; } else { $displayStatus = "none"; } The displayStatus variable gets a value in that script. The value needs to be assigned before you can echo it so it just needs to be placed before you do: echo $displayStatus; As for the booking.php page, you dont need to change that. -
[SOLVED] Controlling Javascript with php???
RichardRotterdam replied to craigtolputt's topic in PHP Coding Help
Use php to check if the form was send after you submit the form you can set the css to show the hidden div. something like this <?php /** * check if the form was send * if it was then display block will be set * if not then display none will be set */ $displayStatus = (isset($_POST['contactus']))?"block":"none"; ?> <div id="slideBody2" style="height: 230px; display: <?php echo $displayStatus;?>;"> Your form html here </div> -
Using the print_r function you will be able to see what's inside your $game variable. <?php // load SimpleXML $games = new SimpleXMLElement('http://www.expekt.com/exportServlet?category=SOC%25', null, true); echo "<pre>",print_r($games),"<pre>"; Try that code and it should be a piece of cake filtering the data you want edit Hang on your code should work. What php version are you running?
-
[SOLVED] php var into js = headache
RichardRotterdam replied to abazoskib's topic in Javascript Help
A couple of questions for you regarding the following code <script type="text/javascript"> setTimeout( extendSession, 10798000, "d8aee766_addf_4cc5_b51c_17294215f928" ); </script> the third arguement is optional and the values allowed are (JScript | VBScript | JavaScript) That third value does not make sense here. What does the extendSession function look like? maybe your javascript should look like: <script type="text/javascript"> setTimeout('extendSession( "<?php echo $id; ?>")', <?php echo $timeLeft; ?>); </script> -
Maybe you'd like the following tutorial published on the main site of phpfreaks. http://www.phpfreaks.com/tutorial/handling-xml-data Providing a script that does what you want might work on a short term but getting you to know how to work with it will be more valuable in the end. I also think that using simpleXML might be a bit easier to work with even though there is nothing wrong with DOMElement
-
[SOLVED] php var into js = headache
RichardRotterdam replied to abazoskib's topic in Javascript Help
I suggest you look in your browser source and see how the javascript gets generated. What does that look like in plain javascript? -
If for example you create an error on purpose do you a error in your browser? Check the manual for the error_reporting Also you might want to test something on a local pc first.
-
You're talking about jsonp which is just a way to make cross site data exchange possible with javascript. This is not purpose of the src attribute. If the ajax call is all locally then you don't need this.
-
AJAX with the XmlHttpRequest and The src attribute in the script tag are not even comparable. Ajax (as said before) is used to refresh certain parts of a page or handling data serverside without leaving a page. The src attribute of the script tag is simply used to include a javascript.
-
Uhm (drool emote here) http://webdemos.sourceforge.net/haxesandy/modelloading-js.htmlL That is just way too cool for javascript. I'll keep on using Firefox till there is a Firebug equivalent for Chrome. A Linux version of Chrome would also be nice.
-
Ah Thrope beat me to it but anyway. $SMS->send('44123456789, 'SMS Alert from $_REQUEST["emailaddress"]'); Since you are using single quotes the variable value wont be placed in the string. Using double quotes like the following will also work $SMS->send('44123456789, "SMS Alert from {$_REQUEST['emailaddress']}");