harristweed
Members-
Posts
346 -
Joined
-
Last visited
-
Days Won
1
Everything posted by harristweed
-
Only one script works at a time.................What Gives?
harristweed replied to Modernvox's topic in PHP Coding Help
echo what's being received from the posted forms, that will point you in the right direction. -
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); } } ?>
-
This should be real easy but I can't seem to do it
harristweed replied to Texas's topic in PHP Coding Help
Possibly because the javascript file is external! <script type="text/javascript" src="imnothere.js"></script> -
php registration system - added to database even if there's errors
harristweed replied to Ruko's topic in PHP Coding Help
Dyslexia rules KO! if($errors > 0) DOH! -
php registration system - added to database even if there's errors
harristweed replied to Ruko's topic in PHP Coding Help
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 } -
Getting parse error simple code modification needed
harristweed replied to enovatit's topic in PHP Coding Help
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); ?> -
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: http://www.fonts.com/FindFonts/detail.htm?pid=414225
-
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!
-
Need HELP! PHP code not working on a webserver
harristweed replied to oneplusdave's topic in PHP Coding Help
I suspect that you don't have a connection to the database. Try echoing $connection. -
Need HELP! PHP code not working on a webserver
harristweed replied to oneplusdave's topic in PHP Coding Help
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. -
Can someone tell me why my pho form code is not showing on the web?
harristweed replied to oavs's topic in PHP Coding Help
...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']; ?> -
Can't use function return value in write context
harristweed replied to myrddinwylt's topic in PHP Coding Help
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++; } } ?>
-
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
-
Well MrAdam just shows you should never assume!
-
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff
-
<input type="checkbox" value=" yes" name="checkbox" <?php if($_POST['checkbox']=="yes")echo " checked = \"checked\" ";?> >
-
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!