Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. I'd guess that will require javascript. However it depends on where the sound is coming from. If its a flash object then you'll have to add the mute button into the flash movie. If you're embedding a mediaplayer object into the page then I think you can control the volume via javascript.
  2. 1. Simply do: $textarea_text = $_POST['textarea_name']; $textarea_text_array = explode("\n", $textarea_txt); echo '<pre>' . print_r($textare_text_array, true) . '</pre>'; Edit: beaten by MadTechie 2. That will be done in javascript.
  3. How do you start the foreach loop. In order for endforeach to work, the foreach statement will need to be like this: <?php foreach($arr as $key => $value): ?> Notice the colon at the end. Then to close the foreach call the endforeach keyword. Code as whole: <?php foreach($arr as $key => $value): ?> ... your html here ... <?php echo $key . '=>' . $value; ?><br /> ... more html ... <?php endforeach; ?>
  4. I have, look at my code example above. If you do not understand if statements then you should have a read of the manaul
  5. Apple is using Apple Update to automatically install Safari on users computers. I thought the whole idea of having an update client is for updating applications already installed on your computer, not to install software which you don't have. It is causing quite a debate amongst other users and Mozilla.
  6. Just add $valid=0; in the if/else statement: if(isset($_POST['Price'])) { $valid = 1; if(empty($_POST['Price'])) { $valid = 0; $price_error = 'Please provide a price'; } elseif(!is_numeric($_POST['Price'])) { $valid = 0; $price_error = 'Price is invalid. Numbers only (eg: 123.45)'; } }
  7. Also there is no point in doing ''.$var_name.'' when using variables, just use $varname, eg: unset($_SESSION[$name]);
  8. That wont be secure. As the password can see from the source code and it can be bypassed by disabling javascript. If you want to keep passwords private then use PHP
  9. The $_SERVER variable will only allow you to retrieve the user agent (the web browser name and version/Operating system and version), eg: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 You wont be able to detect what add-ons a user has installed. You will most probably have to use javascript for that, there might be some API which you can use.
  10. I have cleaned your decode function: function decode($jsonToArr) { $jsonToArr = str_replace(array('"', '\'', '{', '}'), '', $jsonToArr); $bits = explode(',', $jsonToArr); $Arr = array(); foreach($bits as $part) { list($key, $value) = explode(':', $part); $Arr[$key] = $value; } return $Arr; } $testStr = '{"camera":nikon,"aperture":f3.5,"exposure":1/250}'; $exifArr = decode($testStr); echo $exifArr['camera'];
  11. No need to for any complex regex <?php if(isset($_POST['Price'])) { if(empty($_POST['Price'])) { $price_error = 'Please provide a price'; } elseif(!is_numeric($_POST['Price'])) { $price_error = 'Price is invalid. Numbers only (eg: 123.45)'; } } ?> <input type="text" class="itemEditForm04" name="Price" value="<?php $row['Price'];?>" /> <?php if($price_error): ?><span style="font-size: 8pt; color:#FF0000"><?php echo $error_price; ?></span><?php endif; ?>
  12. Is the file acoole.ini created/edited by your script? if it is then it is in the wrong place. You are only allowed to create files in /home/cpsfrp the acoole.ini file is in /home/panel/public_html/server/sfrp/sa-mp/scriptfiles which is out of bounds to you. I don't think you can disable open_basedir yourself if you dont have access to the php.ini.
  13. How are including the header file. If its a relative path, eg: include 'header.php'; // OR include 'C:/path/to/header.php'; Then header.php will have the same variable scoop as index.php. If you're using an absolute path which is a url, eg: include 'http://www.yoursite.com/header.php' Then PHP will parse the contents of header.php and return the output to index.php.
  14. PHP is currently reading a php.ini in C:\WINDOWS\ if you are editing the php.ini in C:\Appserv\php5 either delete the current php.ini in C:\WINDOWS or overwrite it with the one in C:\Appserv\php5 Make sure your restart Appserv after moving the php.ini
  15. Run phpinfo() and post what the Configuration File (php.ini) Path and Loaded Configuration File lines are set to. One of those two lines should point to the php.ini you are editing (C:\Appserv\php5\php.ini)
  16. $Logged = (isset($_GET['Logged']) && $_GET['Logged'] == 'Yes') ? 'Yes' : 'No'; switch($Logged) { case 'No': echo '<p style="color:red">login UNsuccessful NO Content</p>'; break; case 'Yes': echo '<p style="color:green">login successful Content</p>'; default: echo'Default Content'; break; }
  17. You're redirecting user and calling the setOptions function at the same time. The setOptions function will never run as javascript will redirect the user before it gets to call the setOptions funcion. I'd say add redirection code at the end of the setOptions function.
  18. Line 19 should be: if(mysql_num_rows($result)=='0'){
  19. You should use == not = == comparison = assignment
  20. So you want one for HTML/CSS? If so have a look at http://www.fckeditor.net/
  21. For PHP programming? PHP is not a click and drag language like HTML/CSS is. Most PHP enerated code form WYSIWYG editors is bloated and incredibly complex, especially when it doesn't work. You should code by hand. Also have a read of this thread for a recommended PHP editor
  22. Always set the extension_dir with an absolute path: extension_dir = "C:/Appserv/php5/ext" also in order for php to display errors if it is having issues loading extensions during startup you'll need to enable the display_startup_error setting in the php.ini too. Save the php.ini and restart Appserv
  23. Just use number_format again: number_format ($amount, 2, '.', '') The forth parameter is the thousands seperator.
  24. Thats what you had originally! ???
  25. It will stop the script completely and only display the mysql error which will help you to debug your query.
×
×
  • 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.