harristweed
-
Posts
346 -
Joined
-
Last visited
-
Days Won
1
Posts posted by harristweed
-
-
the variable $options will contain whatever was selected on the form. If you want $options to be specifically option 5, all I can suggest is change:
$options = $_POST['theoptions'];
to
$options = 5
-
<?php $directory="..\yourdirectory"; $dir="$directory"; $dp=opendir($dir); while($file = readdir($dp)){ if($file != '.' && $file != '..' ){ $insert=" insert into table ( file_name_table ) values ( '$file')"; mysql_query($insert,$link_id); } } ?>
-
Possibly because the javascript file is external!
<script type="text/javascript" src="imnothere.js"></script>
-
Dyslexia rules KO!
if($errors > 0)
DOH!
-
this is a bit 'cor blimmey' but a simple way is with a flag.
$errors=0; // add flag to all error checks if (!$_POST["user"] | !$_POST["pass"] | !$_POST["email"] ) { echo "<div class='error'>Please fill in the required fields</div>"; $errors=1; } // then test the flag before putting data into database if ($flag < 1){ // add data }else{ //show error message }
-
you need some content between a set of tags......
<?php $xml=simplexml_load_string ('<?xml version="1.0" encoding="utf-8"?><title>where is the content?</title>'); print_r($xml); ?>
-
Is this a PHP problem?
-
To verify, use the font in MsWord or other program, and try the characters. If that is the problem you can solve it easily. Buy the full version:
-
My point is: can that font display those characters? The problem is the font not PHP
-
Are these characters available in the font? Can you display them in any other application?
-
Happens to me all the time in Crome. I use Firefox for dev work. Not a PHP issue!
-
I suspect that you don't have a connection to the database. Try echoing $connection.
-
I don't believe this worked on any server!
#selects all data from table and displays it in textfields. If failed, it will display the error $sql = "SELECT * from tblquotes ORDER BY Rand() LIMIT 1";
Does not select all data, it is LIMITED to one row!
And
$result = mysql_query($sql,$connection); if($result = mysql_query($sql ,$connection)) {
runs twice $result = mysql_query($sql,$connection); and I suspect this will move the record pointer on so that the one row you have retrieved is not displayed.
-
...form here ... <input name="total" type="text" class="field text medium" id="total" tabindex="20" value="<?php echo $_POST['total'];?>" maxlength="255" /> </form><?php $total=$_POST['total']; ?>
-
why not
if(empty($cost))$cost="0"
?
-
of course it does! doh!
<?php $rss_file = "http://www.uefa.com/rssfeed/news/rss.xml"; $rss_feed = simplexml_load_file( $rss_file ); $count=1; foreach( $rss_feed->channel->item as $item ) { echo"<a title='$item->title' href='$item->link'> $item->title</a>"; $count++; if($count >10)continue; } ?>
-
<?php $rss_file = "http://www.uefa.com/rssfeed/news/rss.xml"; $rss_feed = simplexml_load_file( $rss_file ); $count=0; foreach( $rss_feed->channel->item as $item ) { while($count<10){ echo"<a title='$item->title' href='$item->link'> $item->title</a>"; $count++; } } ?>
-
-
Well MrAdam just shows you should never assume!
-
-
<input type="checkbox" value=" yes" name="checkbox" <?php if($_POST['checkbox']=="yes")echo " checked = \"checked\" ";?> >
-
if ($email <> "" and !ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", "$email")) { echo"Not ok"; }else{ echo"Yippee"; }
-
I agree but have found that separate scripts are easier to manage but that just a personal preference.
-
If the page is refreshed then the data will update again. Therefore I suggest have the form access a script, the update script is held in a separate file, after a successful update redirect back to the form then refresh of the form will refresh that page and not the update script!
Only one script works at a time.................What Gives?
in PHP Coding Help
Posted
echo what's being received from the posted forms, that will point you in the right direction.