wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Trying to redirect to html page without using header variable
wildteen88 replied to dragin99's topic in PHP Coding Help
The reason why you are getting the error message is becuase you are outputting something to the browser. You cannot use the header function if you have ouput before the use of header or anyother header style function such as setcookie, session_start etc. You can use the old html style which is a meta refresh instead. -
If you want to edit something in a file then you'll want to get the contents of the file, apply the changes and then rewrite the file. You will want to use fopen, fread, str/preg_replace or other functions and then fwrite and fclose.
-
Unless he means error messages which he may define in his script such as someone didn't fill in required field in a form. If you are dealing with forms then javascript is the best tool as you can get javascript to check whether the user filled in the required fields with the correct data and prevent the form from submitting if it does have errors.
-
Something like this: [code]<?php $array = array("hello", "world", "again"); // loop through array foreach($array as $key) { // check that the current value $key is equal to the last value in the arrray if($key == end($array)) { echo "end of array! - " . $key . "<br />\n"; // end of array } else { echo "array is at key " . $key . "<br />\n"; // not end of array } } ?>[/code]
-
It just pays to spend that extra time searching around. But anyway no problem.
-
Sure. Change this bit: [code]Print "<td><a href=\"pets.html\">".$row['pet'] . "</a></td></tr>";[/code]to [code]Print "<td><a href=\"" . $row['pet'] . ".html . "\">".$row['pet'] . "</a></td></tr>";[/code]
-
You wont get any errors becuase your are suppressing them, as you have an @ symbol infront of your $_REQUEST['streamname'] variable, as seen below: [code]$streamname=@$_REQUEST['streamname'];[/code] When you remove the @ symbol you may get a notice message Also it appreas that you dont have a submit button in order to submit the form data. If you have nothing for submitting a form then your data will never be sent as you havnt told the browser to submit the form data.
-
MediaWiki already has a couple of predefined scripts that can integrate MediaWiki with a couple of forums, such as phpBB, SMF, IPB etc [a href=\"http://meta.wikimedia.org/wiki/Category:Integration\" target=\"_blank\"]here[/a]
-
You should add cury braces around your variables in a HEREDOC statement like so: {$_SERVER['PHP_SELF']} otherwise you'll get the error message you are curtrently getting. Wrapping curly brakets around a variable shows PHP where the variable starts and ends basically.
-
Yes use the :hover persuado class. NOTE: currently IE6 doesn't support the :hover persuado class on any tag accept the anchor (a) tag, but IE7 now supports the :hover persuado class on any tag.
-
I use a program called [a href=\"http://www.blumentals.net/rapidphp/\" target=\"_blank\"]Rapid PHP[/a]. It has full HTML/Javascript and CSS support and is designed towards developing PHP scripts and has an inbuilt PHP Syntax checker (requires the php intepreter to be installed on your computer) and syntax highlighting for a number of programming langauges. It costs a mear $30 ($29.85 to be exact). There is also another PHP editor I used to use which is called PHP Designer 2006 which is 100% free!
-
I see the error now. Change this: [code]<?php virtual('/Connections/salford.php'); ?>[/code] to [code]<?php require_once('/Connections/salford.php'); ?>[/code]
-
change the following: [code]Print "<th>Pet:</th> <td>".$info['pet'] . " </td></tr>";[/code] to: [code]Print "<th>Pet:</th> <td><a href=\"pets.html\">".$info['pet'] . "</a></td></tr>";[/code]
-
There is usally a delay when sending an email with mail. Also check that your email client isn't putting your emails into the Junk/Spam folder.
-
You have an error in your sql query that is why your are retrieving that error. So change the following: [code] $query = "SELECT category, model_number, quantity FROM models WHERE model_number=$id"; $result = @mysql_query ($query); if (mysql_num_rows($result) ==1){[/code]to[code] $query = "SELECT category, model_number, quantity FROM models WHERE model_number=$id"; $result = @mysql_query ($query) or die("Query error: <i>" . $query . "</i><br><br>" . mysql_error()); if (mysql_num_rows($result) ==1){[/code] When you run your edit script again PHP/MySQL will report a proper error message in the following format: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Query error: [i][query here][/i] [mysql error here][/quote]
-
Well theres a clue in the error message. virtual is being called on line 1 in [b]dpage.php[/b]. If you post the code here we should be able to help. As far as I know virtual is used to include and parse shtml files and is an Apache specific function.
-
How can i get requested info from MySQL using php?
wildteen88 replied to curiosus's topic in PHP Coding Help
Change the below code: [code]<? for($count = 0; $count < mysql_numrows($result); $count++) { ?><tr> <td><?echo mysql_result($result,$count,"code")?></td> <td><?echo mysql_result($result,$count,"name")?></td> <td><?echo mysql_result($result,$count,"price")?> USD</td> </tr> <? } ?>[/code] To the following: [code]<?php while($row = mysql_fetch_array($result)) { ?> <tr> <td><?php echo $row['code']; ?></td> <td><?php echo $row['name']; ?></td> <td>$<?php echo $row['price']; ?> USD</td> </tr> <?php } ?>[/code] -
If your POSTed data is having there quotes escaped (\" or \') then you PHP setup has magic quotes enabled which escapes quotes automatically for you. You can temporarly disable magic quotes for your script by adding the following to the top of your php script: [code]?<?php if (get_magic_quotes_gpc()) { set_magic_quotes_runtime(0); } ?>[/code] That should temporarly shutdown magic quotes.
-
Change your code to the following: [code]//PASSWORD VERIFICATION if (($pass)!=($pass2)) { header("Redirect: 5; URL=error-pwverify.php"); //the user will be sent to this page after 5 secounds die("The password you specified does not match the password set. Please try again.<br /><br />This page will be redirected in 5 secounds"); }[/code]
-
What you will want to do is upon upload you will want chekc the database first to see if the picture file name is already in the database and if so just use the UPDATE statement or if the file doesn't exists use the INSERT statement intsead.
-
The only way to convert a string into a timestamp (UNIX) is strtotime. MySQL supports UNIX timestamps.
-
You'll want to download the [b]Windows Binaries[/b] Zipped package ([i]PHP 5.1.4 zip package [/i]) Onced downloaded extract the contents to C:\php Also in order to view you pages in a browser you will need Apache and possible MySQL too if your site uses a mysql database. Rather than downloading individual bits of software you might want to download a software package called [a href=\"http://www.wampserver.com/en/index.php\" target=\"_blank\"]WAMP[/a].
-
Please do not most multiple instances of your problem around different forums. You already posted this in the [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=92935\" target=\"_blank\"]PHP Installation[/a] forum. Thread Closed.