PHP - Getting The Content Of The Field
What I'm trying to figure out how to do is when its getting the content for the field it needs to get the ID of the field that way it can get the content of the field. I'm not sure what I'm doing wrong.
Code: [Select] <?php require ('php/bios.php'); ?> <script type="text/javascript" src="forms/edit/js/bios.js"></script> <!-- Title --> <div id="title" class="b2"> <h2>Character Management</h2> </div> <!-- Title --> <!-- Inner Content --> <div id="innerContent"> <form action="#" id="bioForm" > <?php while ($row = mysqli_fetch_array($groupsResult, MYSQL_ASSOC)) { echo "<fieldset> <legend>" . $row['groupName'] . "</legend>"; $fieldsResult = mysqli_query ( $dbc, sprintf($fieldsQuery,$row['ID']) ); while ($row2 = mysqli_fetch_array($fieldsResult, MYSQL_ASSOC)) { echo "<div class=field required>"; if ($row2['inputType'] == "text") { echo "<label for=" . $row2['ID'] . ">" . $row2['fullName'] . "</label>"; echo "<input type=text name=" . $row2['ID'] . " id=" . $row2['ID'] . " class=text biofield title=" . $row2['fullName'] . " />"; } elseif ($row2['inputType'] == "textarea") { echo "<label for=" . $row2['ID'] . ">" . $row2['fullName'] . "</label>"; echo "<textarea name=" . $row2['ID'] . " id=" . $row2['ID'] . " class=textarea biofield title=" . $row2['fullName'] . " />"; } else { echo "<label for=" . $row2['ID'] . ">" . $row2['fullName'] . "</label>"; echo "<select name=" . $row2['ID'] . " id=" . $row2['ID'] . " class=dropdown biofield title=" . $row2['fullName'] . " >"; echo "<option value= >None</option>"; if ($styleID == 1 || $styleID == 2 || $styleID == 6) { $charactersQuery = " SELECT characters.ID, characters.characterName FROM characters WHERE characters.styleID = 3 ORDER BY characters.characterName"; } else { $charactersQuery = " SELECT characters.ID, characters.characterName FROM characters WHERE characters.styleID IN (1,2,6) ORDER BY characters.characterName"; } $charactersResult = mysqli_query ( $dbc, $charactersQuery ); // Run The Query while ( $row3 = mysqli_fetch_array ($charactersResult, MYSQLI_ASSOC)) { echo "<option value=" . $row3['ID'] . ">" . $row3['characterName'] . "</option>\r"; } echo "</select>"; } echo "</div>"; } echo "</fieldset>"; } ?> <fieldset> <input type="hidden" name="defaultCharID" id="defaultCharID" value="<?php echo $defaultCharID; ?>" /> <input type="submit" class="submit" id="editBio" title="Edit Bio" value="Edit Bio" /> </fieldset> </form> </div> <!-- /Inner Content --> Code: [Select] <?php session_start(); // Access the existing session // Include the database page require ('../../inc/dbconfig.php'); $defaultCharID = $_SESSION['defaultCharID']; $styleIDQuery = " SELECT characters.styleID FROM characters WHERE characters.ID = '" . $defaultCharID . "'"; $styleIDResult = mysqli_query ( $dbc, $styleIDQuery ); // Run The Query $row = mysqli_fetch_array( $styleIDResult, MYSQL_ASSOC ); $styleID = $row[ 'styleID' ]; $groupsQuery = " SELECT groups.* FROM groups WHERE groups.styleID = '" . $styleID . "' ORDER BY groups.ID"; $groupsResult = mysqli_query ( $dbc, $groupsQuery ); // Run The Query $fieldsQuery = " SELECT fields.* FROM fields WHERE fields.styleID = '". $styleID . "' AND fields.groupID = '%d' AND fields.statusID = 1"; $fieldContent = " SELECT fieldsContent.* FROM fieldsContent WHERE fieldsContent.characterID = '". $defaultCharID . "' AND fieldsContent.fieldID = = '". $fieldID ."'"; ?> Similar Tutorials(Another quite newbie...) I have already an online booking form. The Form works fine now and I would like to add on one more issue, but the code ignores what I want to check. I have 4 fields: arrival, departure, no. of persons and comments to check. Scenario 1: All field mentioned above are emtpty: Workes fine and message appears: "You have not provided any booking details". Scenario 2: If arrival (date_start) and departure (date_end) is entered, there should be at least an entry either in the field "comment", or in the field "pax". If not, there should be a message: "You have not provided sufficient booking details". INSTEAD: The booking request is sent, which should not be the case. The code is currently: # all fields empty : arrival, departure, pax and comments - error if(empty($data_start) && empty($data_end) && empty($pax)&& empty($comment)){ exit("You have not specified any booking details to submit to us. <br>Please use your browser to go back to the form. <br>If you experience problems with this Form, please e-mail us"); exit; } #If arrival and departure date is entered, there should be at least an entry either in the field "comment", or in the field "pax". if(!isset($data_start) && !isset($data_end) && empty($pax) && empty($comment)){ exit("You have not provided sufficient booking details. <br>Please use your browser to go back to the form. <br>If you experience problems with this Form, please e-mail us"); exit; } The form can be tested at http://www.phuket-beachvillas.com/contact-own/contact-it.php Can someone please check and tell me what's wrong with the code ? Thanks to anyone for any hint. Hello all. I'm new here... and new to php... so please be gentle if I'm overlooking something that's blindingly obvious. I have a 'view blog entries' page and an 'edit blog entries' page. When I go to the 'edit blog entries' page, I want the form fields to display the preexisting blog content for whatever entry I'm about to edit. The code below does display the 'title' but it does not display the 'article' content. (However, the 'title' and 'article' content both show when I view the source code.) Can anyone tell me what I could be doing wrong? Thanks in advance. Code: [Select] // Retrieve the blog post's information: $q = "SELECT title, article FROM entries WHERE article_id=$article_id"; $r = @mysqli_query ($dbc, $q); if (mysqli_num_rows($r) == 1) { // Valid blog entry ID, show the form. // Get the blog entry's information: $row = mysqli_fetch_array ($r, MYSQLI_NUM); echo '<form action="edit_entry.php" method="post"> <p>Title:<br /> <input type="text" name="title" size="45" maxlength="80" value="' . $row[0] . '" /></p> <p>Blog entry<br /> <textarea name="article" id="article" cols="45" rows="5" ' . $row[1] . '></textarea> </p> <p><input type="submit" name="submit" value="Submit" /></p> <input type="hidden" name="submitted" value="TRUE" /> <input type="hidden" name="article_id" value="' . $article_id . '" /> </form>'; } else { // Not a valid entry ID. echo '<p class="error">This page has been accessed in error.</p>'; } mysqli_close($dbc); ?> Stumped! I have a client who has a form where they upload files to their server: title, two password fields, and the file
They have been unable to upload anything over 10m
Small (under 10mb) files work.
Larger doesn’t
I’ve tracked it down, I think, that the processing page appears to be dropping the form values when the file takes a bit to upload.
I echo’ed the values that are grabbed from the form, and they return empty strings if it takes a while for the file to upload (a large file) - they pass fine if the file is smaller.
I think I've got the php info set correctly, but cannot for the life of me figure out how to adjust the timing out issue, or even where to troubleshoot.
Here's my phpinfo:
Max Requests
Per Child: 750 - Keep Alive: off - Max Per Connection: 100
Timeouts
Connection: 120 - Keep-Alive: 5
Directive
Local Value
Master Value
allow_call_time_pass_reference
Off
Off
allow_url_fopen
On
On
allow_url_include
Off
Off
always_populate_raw_post_data
Off
Off
arg_separator.input
&
&
arg_separator.output
&
&
asp_tags
Off
Off
auto_append_file
no value
no value
auto_globals_jit
On
On
auto_prepend_file
no value
no value
browscap
/etc/browscap.ini
/etc/browscap.ini
default_charset
no value
no value
default_mimetype
text/html
text/html
define_syslog_variables
Off
Off
disable_classes
no value
no value
disable_functions
leak,posix_getpwuid,posix_getpwnam,posix_getgrid,posix_getgrnam,posix_getgroups
leak,posix_getpwuid,posix_getpwnam,posix_getgrid,posix_getgrnam,posix_getgroups
display_errors
Off
Off
display_startup_errors
Off
Off
doc_root
no value
no value
docref_ext
no value
no value
docref_root
no value
no value
enable_dl
Off
Off
error_append_string
no value
no value
error_log
/mnt/Target01/337846/945285/www.dermerrealestate.com/logs/php_errors.log
no value
error_prepend_string
no value
no value
error_reporting
30711
30711
exit_on_timeout
Off
Off
expose_php
Off
Off
extension_dir
/usr/lib64/php/modules
/usr/lib64/php/modules
file_uploads
On
On
highlight.bg
#FFFFFF
#FFFFFF
highlight.comment
#FF8000
#FF8000
highlight.default
#0000BB
#0000BB
highlight.html
#000000
#000000
highlight.keyword
#007700
#007700
highlight.string
#DD0000
#DD0000
html_errors
On
On
ignore_repeated_errors
Off
Off
ignore_repeated_source
Off
Off
ignore_user_abort
Off
Off
implicit_flush
Off
Off
include_path
.:/usr/share/pear:/usr/share/php
.:/usr/share/pear:/usr/share/php
log_errors
On
On
log_errors_max_len
1024
1024
magic_quotes_gpc
On
On
magic_quotes_runtime
Off
Off
magic_quotes_sybase
Off
Off
mail.add_x_header
On
On
mail.force_extra_parameters
no value
no value
mail.log
no value
no value
max_execution_time
30
30
max_file_uploads
20
20
max_input_nesting_level
64
64
max_input_time
60
60
max_input_vars
1000
1000
memory_limit
128M
128M
open_basedir
no value
no value
output_buffering
no value
no value
output_handler
no value
no value
post_max_size
8M
8M
precision
14
14
realpath_cache_size
4M
4M
realpath_cache_ttl
120
120
register_argc_argv
On
On
register_globals
Off
Off
register_long_arrays
On
On
report_memleaks
On
On
report_zend_debug
On
On
request_order
no value
no value
safe_mode
Off
Off
safe_mode_exec_dir
no value
no value
safe_mode_gid
Off
Off
safe_mode_include_dir
no value
no value
sendmail_from
no value
no value
sendmail_path
/usr/sbin/sendmail -t -i
/usr/sbin/sendmail -t -i
serialize_precision
100
100
short_open_tag
On
On
SMTP
localhost
localhost
smtp_port
25
25
sql.safe_mode
Off
Off
track_errors
Off
Off
unserialize_callback_func
no value
no value
upload_max_filesize
8M
8M
upload_tmp_dir
/tmp
/tmp
user_dir
no value
no value
user_ini.cache_ttl
300
300
user_ini.filename
.user.ini
.user.ini
variables_order
EGPCS
EGPCS
xmlrpc_error_number
0
0
xmlrpc_errors
Off
Off
y2k_compliance
On
On
zend.enable_gc
On
On
This is my first real jump into PHP, I created a small script a few years ago but have not touched it since (or any other programming for that matter), so I'm not sure how to start this. I need a script that I can run once a day through cron and take the date from one table/filed and insert it into a different table/field, converting the human readable date to a Unix date. Table Name: Ads Field: endtime_value (human readable date) to Table Name: Node Field: auto_expire (Converted to Unix time) Both use a field named "nid" as the key field, so the fields should match each nid field from one table to the next. Following a tutorial I have been able to insert into a field certain data, but I don't know how to do it so the nid's match and how to convert the human readable date to Unix time. Thanks in advance!. Hi: I'm going crazy trying to do the following: I'm making a job registration process where the user registers on one php page to the website, must acknowlege and email receipt using an activate php page, then is directed to upload their C.V. (resume) based on the email address they enter in the active page output. I then run an upload page to store the resume in teh MySQL db based on the users email address in the same record. If I isolate the process of the user registering to the db, it works perfectly. If I isolate the file upload process into the db, it works perfect. I simply cannot upload teh file to the existing record based on teh email form field matching the user_email field in the db. With the processes together, teh user is activated, but teh file is not uploaded. Maybe I've simply been at this too long today, but am compeled to get through it by end day. If anyone can help sugest a better way or help me fix this, I will soo greatly appreciate it. My code is as follows for the 2 pages. ---------activate.php------- <?php session_start(); include ('reg_dbc.php'); if (!isset($_GET['usr']) && !isset($_GET['code']) ) { $msg = "ERROR: The code does not match.."; exit(); } $rsCode = mysql_query("SELECT activation_code from subscribers where user_email='$_GET[usr]'") or die(mysql_error()); list($acode) = mysql_fetch_array($rsCode); if ($_GET['code'] == $acode) { mysql_query("update subscribers set user_activated=1 where user_email='$_GET[usr]'") or die(mysql_error()); echo "<h3><center>Thank You! This is step 2 of 3. </h3>Your email is confirmed. Please upload your C.V. now to complete step 3.</center>"; } else { echo "ERROR: Incorrect activation code... not valid"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Job application activation</title> </head> <body> <center> <br/><br/><br/> <p align="center"> <form name="form1" method="post" action="upload.php" style="padding:5px;"> <p>Re-enter you Email : <input name="email" type="text" id="email"/></p></form> <form enctype="multipart/form-data" action="upload.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="4000000"> Upload your C.V.: <input name="userfile" type="file" id="userfile"> <input name="upload" type="submit" id="upload" value="Upload your C.V."/></form> </p> </center> </body> </html> --------upload.php---------- <?php session_start(); if (!isset($_GET['usr']) && !isset($_GET['code']) ) { $msg = "ERROR: The code does not match.."; exit(); } if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $email = $_POST['email']['user_email']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } include 'reg_dbc.php'; $query = "UPDATE subscribers WHERE $email = user_email (name, size, type, content ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content')"; mysql_query($query) or die('Error, query failed'); mysql_close($dbname); } ?> <center> <br/> <br/> <br/> <br/> Thank you for uploading your <?php echo "$fileName"; ?> file, completing your registration, and providing us your C.V. for this position. <br/> <br/> <br/> We will contact you if your canditature qualifies. </center> Code: [Select] $new_array2=array_diff($my_array,$itemIds); $updatedb = mysql_query("UPDATE content_type_ads SET field_expire_value = '666' WHERE $new_array2 = field_item_id_value"); "$new_array2" has only 12 digit numbers for each item in the array, and I want to match them to the "field_item_id_value" field in the table, updating the "field_expire_value" field for the record where they match. I know I am close because the UPDATE code works before I add the WHERE statement (it of course adds '666' to EVERY field, but for a noobie it's a start!). Hi, I'm developing an app using flash AS2 as the front end via PHP and a mySQL database at the backend on my server. what i'm looking to do is update/insert into a table called 'cards' and at the same time update/insert into another table called 'jingle'. There is a field called 'cardID' in jingle that should be the same as the ID number created in 'cards' thus creating a link between entries in the different tables that can be called up as i choose. hope i've been clear i just wouldn't know where to start any help would be appreciated. MySQL client version: 5.0.91 PHPmyAdmin Version information: 3.2.4 thanks in advance How should it look if I want to make a query where a field value should be lower than another field? Code: [Select] ....WHERE total_points<max_points"); Hi, I will start off trying to explain what I am trying to make the best I can. What I want to create is a script that gets the gold value from this website: http://www.lbma.org.uk/pages/index.cfm?page_id=46&title=current_statistics and then save it to a variable which I will use to calculate values of different gold karats. Here is the content in bold I need on the website I linked: Quote LONDON GOLD FIXING USD GBP EUR AM 1588.00 1005.127 1251.083 PM 1589.50 1004.741 1249.803 So what help do I need? Well, I don't expect you to figure out the calculating part for me but some help how to get that content pointed out above and save it to a variable is what I would appreciate getting some help with. I don't know much PHP, only some and I have been trying to figure this out for a day now without any success. I suppose php get contents and/or curl should be used here but I don't know how really. I would very much appreciate the help I can get on this. Thank you! Hey guys, I am a webmaster for my church and I am fairly new to PHP. What am trying to is when a visitor goes to our radio ministry page and clicks a button which the message number is displayed in the read only textbox, it will go to my request CD page and auto populate the message number in that text field form the readonly text field from the previous page. I will show my code for both pages for you to review. This is the Radio page (where I want to take the message number value from) Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="Living Word Community Church radio ministry" /> <meta name="keywords" content="reformed radio fort worth, reformed radio dallas, biblical radio fort worth, biblical radio dfw" /> <title>In Light of Scripture-Radio Ministry</title> <link href="_css/Main.css" rel="stylesheet" type="text/css" /> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="container"> <div class="header"><a href="index.php"><img src="_images/LWCCWeb.jpg" alt="Insert Logo Here" name="Insert_logo" width="960" height="200" id="Insert_logo" style="background: #D8BF78; display:block;" /></a> <?php include("_includes/header.php"); ?> <div class="sidebar1"> <p></p> <table width="150" border="0" cellpadding="10" align="left"> <tr> <td><a href="directions.php"><img src="_images/ChurchBox.png" width="150" height="125" alt="Directions" /></a></td> </tr> <tr> <td><img src="_images/Service Times.png" width="150" height="778" alt="Service Times" /></td> </tr> </table> <!-- end .sidebar1 --></div> <div class="content"> <div id="radio"></div> <table width="600" border="0" cellpadding="10"> <tr> <td><img src="_images/ILOS.png" width="600" height="111" alt="In Light of Scripture" /></td> </tr> <tr> <td style=" padding-top:25px"><p><font size="5"><b>In Light of Scripture</b> has been locally broadcast for more than 25 years.<br /> This Sunday morning radio program features the expositional teaching of Pastor Stan McGehee Jr. </font><p/></td> </tr> </table> <div id="mediagraph"><a href="http://kdkr.org" target="_blank"><img src="_images/kdkr.jpg" width="300" height="200" alt="Braodcast on KDKR 91.3 Sunday Mornings at 7:30" /></a></div> <br /><br /> <font size="2"><p align="center"><b>The sermon featured this week on "In Light of Scipture" is</b></p></font> <font size="2"><p align="center" style="color:#711726"><b><i>Peace Despite Tribulation</i></b></p></font> <div id="messagenumber" align="center"> <form action="" method="get" name="messagenumber"> <input name="" type="text" value="JR-843" size="6" readonly="readonly" /> <input name="GetMessage" type="button" value="Get Message" /> </form> </div> <!-- end .content --></div></div> <div class="sidebar2"> <table width="150" border="0" cellpadding="16" align="left"> <tr> <td><a href="reformation.php"><img src="_images/MenuBox1.png" width="150" height="125" alt="What Do We Mean by Reformed?" /></a></td> </tr> <tr> <td><a href="ServiceTimesAndCal.php"><img src="_images/MenuBox2.png" width="150" height="125" alt="Worship Service Schedule and Calendar" /></a></td> </tr> <tr> <td><a href="radio.php"><img src="_images/MenuBox3.png" width="150" height="125" alt="In Light of Scripture Radio Ministry" /></a></td> </tr> <tr> <td><a href="cable.php"><img src="_images/MenuBox4.png" width="150" height="125" alt="Living Word Today Cable Program" /></a></td> </tr> <tr> <td><a href="Sermons.php"><img src="_images/MenuBox5.png" width="150" height="125" alt="Listen to Sermons Online" /></a></td> </tr> <tr> <td><a href="http://www.lwcchurch.org/blog/" target="_blank"><img src="_images/MenuBox6.png" width= "150" height="125" alt="Read our reformed blog" /></a></td> </tr> </table> <!-- end .sidebar2 --></div> <?php include("_includes/footer.php"); ?> <!-- end .container --></div> <script type="text/javascript"> var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); </script> </body> </html> This is for the CD request form. I want it to populate the Message# text field Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="Order Living Word Community Church sermons and teachings on CD" /> <meta name="keywords" content="Stan McGehee cd, Reformed teachings on cd, Biblical teachings on cd, LWCC cds" /> <title>Order CD's Online</title> <link href="_css/Main.css" rel="stylesheet" type="text/css" /> <link href="js/jquery.datepick.css" rel="stylesheet" type="text/css" /> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery/jquery-1.5.js"></script> <script type="text/javascript" src="js/jquery.datepick.js"></script> <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationRadio.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(function() { $('#popupDatepicker').datepick(); $('#inlineDatepicker').datepick({onSelect: showDate}); }); function showDate(date) { } </script> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="container"> <div class="header"><a href="index.php"><img src="_images/LWCCWeb2.png" alt="Insert Logo Here" name="Insert_logo" width="960" height="200" id="Insert_logo" style="background: #D8BF78; display:block;" /></a> <?php include("_includes/header.php"); ?> <div class="sidebar1"> <p></p> <table width="150" border="0" cellpadding="10" align="left"> <tr> <td><a href="directions.php"><img src="_images/ChurchBox.png" width="150" height="125" alt="Directions" /></a></td> </tr> <tr> <td><img src="_images/Service Times.png" width="150" height="890" alt="Service Times" /></td> </tr> </table> <!-- end .sidebar1 --></div> <div class="content"> <h2 style="padding-left:50px"> Order messages on CD from LWCC</h2> <div id"form"> <form action="FormToEmail2.php" method="post"> <table width="550" border="0" cellpadding="10"> <tr> <td><table width="550" border="0" cellpadding="10"> <tr> <td width="190">First Name:</td> <td width="314"><span id="spryfirstname"> <input name="firstname" type="text" id="firstname" maxlength="20" /> <span class="textfieldMaxCharsMsg">Too many letters</span><span class="textfieldRequiredMsg">Enter first name </span></span></td> </tr> <tr> <td>Last Name:</td> <td><span id="sprylastname"> <input name="lastname" type="text" id="lastname" maxlength="20" /> <span class="textfieldRequiredMsg">Enter last name</span><span class="textfieldMaxCharsMsg">Too many letters</span></span></td> </tr> <tr> <td>Email<font size="2"> (So we can confirm if needed)</font>:</td> <td><span id="spryemail"> <input name="email" type="text" id="email" maxlength="50" /> <span class="textfieldRequiredMsg">Enter Email</span><span class="textfieldInvalidFormatMsg">Must be Email.</span><span class="textfieldMaxCharsMsg">Email too long</span></span></td> </tr> <tr> <td>Street:</td> <td><span id="sprystreet"><span id="sprystreet"> <input name="street" type="text" id="street" maxlength="50" /> <span class="textfieldRequiredMsg">Enter Street Address</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span></td> </tr> <tr> <td>City:</td> <td><span id="sprycity"><span id="sprytextfield5"> <input name="City" type="text" id="city" maxlength="50" /> <span class="textfieldRequiredMsg">Enter your city</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span><span class="textfieldRequiredMsg">Enter Email</span><span class="textfieldInvalidFormatMsg">Must be Email.</span><span class="textfieldMaxCharsMsg">Email too lon</span></span></td> </tr> <tr> <td>Apartment number:</td> <td><span id="aptnum"> <input name="Apt number" type="text" id="aptnum" maxlength="6" width="80px" /> <span class="textfieldRequiredMsg">Enter Email</span><span class="textfieldInvalidFormatMsg">Must be Email.</span><span class="textfieldMaxCharsMsg">Email too long</span></span></td> </tr> <tr> <td>State:</td> <td><span id="spryselect1"> <select name="statelist"> <option value="null"></option> <option value="Alabama">AL</option> <option value="Alaska">AK</option> <option value="Arkansas">AR</option> <option value="Arizona">AZ</option> <option value="California">CA</option> <option value="Colorado">CO</option> <option value="Connecticut">CT</option> <option value="Deleware">DE</option> <option value="District of Columbia">DC</option> <option value="Florida">FL</option> <option value="Georgia">GA</option> <option value="Hawaii">HI</option> <option value="Idaho">ID</option> <option value="Iowa">IA</option> <option value="Illinois">IL</option> <option value="Indiana">IN</option> <option value="Kansas">KS</option> <option value="Kentucky">KY</option> <option value="Louisiana">LA</option> <option value="Massachusetts">MA</option> <option value="Maryland">MD</option> <option value="Maine">ME</option> <option value="Michigan">MI</option> <option value="Minnesota">MN</option> <option value="Missouri">MO</option> <option value="Mississippi">MS</option> <option value="Montana">MT</option> <option value="Nebraska">NE</option> <option value="New Hampshire">NH</option> <option value="New Jersey">NJ</option> <option value="New Mexico">NM</option> <option value="Nevada">NV</option> <option value="New York">NY</option> <option value="North Carolina">NC</option> <option value="North Dakota">ND</option> <option value="Ohio">OH</option> <option value="Oklahoma">OK</option> <option value="Oregon">OR</option> <option value="Pennslyvania">PA</option> <option value="Rhode Island">RI</option> <option value="South Carolina">SC</option> <option value="Tennessee">TN</option> <option value="Texas">TX</option> <option value="Utah">UT</option> <option value="Vermont">VT</option> <option value="Virginia">VA</option> <option value="Washington">WA</option> <option value="Wisconsin">WI</option> <option value="West Virginia">WV</option> <option value="Wyoming">WY</option> </select> <span class="selectRequiredMsg">Please select state</span></span></td> </tr> <tr> <td>Zip Code:</td> <td><span id="spryzip"><span id="sprytextfield6"> <input name="Zip Code" type="text" id="zip" maxlength="50" /> <span class="textfieldRequiredMsg">Enter Zip Code</span><span class="textfieldInvalidFormatMsg">Zip Code is 5 numbers.</span></span><span class="textfieldRequiredMsg">Enter Email</span><span class="textfieldInvalidFormatMsg">Must be Email.</span><span class="textfieldMaxCharsMsg">Email too lo</span></span></td> </tr> <tr> <td>Which Pastor or Teacher?</td> <td> <div id="spryradio1"> <table width="250"> <tr> <td><label> <input type="radio" name="Speaker" value="Pastor Stan McGehee" id="radiogroup_4" /> Pastor Stan McGehee Sr</label></td> </tr> <tr> <td><label> <input type="radio" name="Speaker" value="Pastor Stan McGehee Jr" id="radiogroup_5" /> Pastor Stan McGehee Jr</label></td> </tr> <tr> <td><label> <input type="radio" name="Speaker" value="Pastor Jack McFarland" id="radiogroup_6" /> Pastor Jack McFarland</label></td> </tr> <tr> <td><label> <input type="radio" name="Speaker" value="Steve Bader" id="radiogroup_7" /> Steve Bader</label></td> </tr> </table> <span class="radioRequiredMsg">Please select speaker</span></div></td> </tr> <tr> <td>Where did you hear message?</td> <td> <div id="spryradio2"> <table width="200"> <tr> <td><label> <input type="radio" name="How did you hear?" value="At LWCC" id="RadioGroup1_0" /> At our church</label></td> </tr> <tr> <td><label> <input type="radio" name="How did you hear?" value="On the Radio" id="RadioGroup1_1" /> On the Radio</label></td> </tr> <tr> <td><label> <input type="radio" name="How did you hear?" value="On Cable" id="RadioGroup1_2" /> On Cable</label></td> </tr> </table> <span class="radioRequiredMsg">Please make a selection</span></div></td> </tr> <tr> <td>What service?</td> <td><div id="spryradio3"> <table width="248"> <tr> <td width="240"><label> <input type="radio" name="When did you hear message?" value="Sunday AM" id="When did you hear message?_0" /> Sunday AM</label></td> </tr> <tr> <td><label> <input type="radio" name="When did you hear message?" value="Sunday PM" id="When did you hear message?_1" /> Sunday PM</label></td> </tr> <tr> <td><label> <input type="radio" name="When did you hear message?" value="Wednesday PM" id="When did you hear message?_2" /> Wednesday PM</label></td> </tr> <tr> <td><label> <input type="radio" name="When did you hear message?" value="Adult Sunday School" id="When did you hear message?_3" /> Adult Sunday School</label></td> </tr> </table> <span class="radioRequiredMsg">Please make a selection.</span></div></td> </tr> <tr> <td>Message Number <font size="2">(If known)</font>: </td> <td><input name="Message#" type="text" id="messagenumber" maxlength="50" /></td> </tr> </table> </td> </tr> <tr> <td><table width="550" border="0" cellpadding="10"> <h3 style="padding-left:135px">Please pick date of message</h3> <div id="selectdate" align="center"><input id="inlineDatepicker" name="When Did You Hear?" type="text" /></div> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-4715900-1"); pageTracker._initData(); pageTracker._trackPageview(); </script></table></td> <tr> <td style="padding-left:250px"><input name="submit" value="Submit" type="submit" /> <input name="clearBtn" type="reset" /></td> </tr> </table> </td> </tr> </table> </form></div> <!-- end .content --></div></div> <div class="sidebar2"> <table width="150" border="0" cellpadding="25" align="left"> <tr> <td><a href="reformation.php"><img src="_images/MenuBox1.png" width="150" height="125" alt="What Do We Mean by Reformed?" /></a></td> </tr> <tr> <td><a href="ServiceTimesAndCal.php"><img src="_images/MenuBox2.png" width="150" height="125" alt="Worship Service Schedule and Calendar" /></a></td> </tr> <tr> <td><a href="radio.php"><img src="_images/MenuBox3.png" width="150" height="125" alt="In Light of Scripture Radio Ministry" /></a></td> </tr> <tr> <td><a href="cable.php"><img src="_images/MenuBox4.png" width="150" height="125" alt="Living Word Today Cable Program" /></a></td> </tr> <tr> <td><a href="Sermons.php"><img src="_images/MenuBox5.png" width="150" height="125" alt="Listen to Sermons Online" /></a></td> </tr> <tr> <td><a href="http://lwcchurch.blogspot.com" target="_blank"><img src="_images/MenuBox6.png" width="150" height="125" alt="Read our reformed blog" /></a></td> </tr> </table> <!-- end .sidebar2 --></div> <?php include("_includes/footer.php"); ?> <!-- end .container --></div> <script type="text/javascript"> var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); var sprytextfield1 = new Spry.Widget.ValidationTextField("spryfirstname", "none", {validateOn:["blur"], maxChars:20}); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprylastname", "none", {maxChars:20, validateOn:["blur"]}); var sprytextfield3 = new Spry.Widget.ValidationTextField("spryemail", "email", {maxChars:50, validateOn:["blur"]}); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprystreet", "none", {validateOn:["blur"], maxChars:50}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {maxChars:50, validateOn:["blur"]}); var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur"]}); var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "zip_code", {validateOn:["blur"]}); var spryradio1 = new Spry.Widget.ValidationRadio("spryradio1"); var spryradio2 = new Spry.Widget.ValidationRadio("spryradio2"); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprymessagenumber", "none", {isRequired:false}); var spryradio3 = new Spry.Widget.ValidationRadio("spryradio3"); </script> </body> </html> This is the Code i am using. This is show error: Fatal error: Call to a member function item() on a non-object in /home/domain/public_html/forum/file/Test.php on line 35 Code: [Select] <?php $xml=("http://www.vn-zoom.com/external.php?type=RSS2&forumids=77"); $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); //get elements from "<channel>" $channel=$xmlDoc->getElementsByTagName('channel')->item(0); $channel_title = $channel->getElementsByTagName('title') ->item(0)->childNodes->item(0)->nodeValue; $channel_link = $channel->getElementsByTagName('link') ->item(0)->childNodes->item(0)->nodeValue; $channel_desc = $channel->getElementsByTagName('description') ->item(0)->childNodes->item(0)->nodeValue; //output elements from "<channel>" echo("<p><a href='" . $channel_link . "'>" . $channel_title . "</a>"); echo("<br />"); echo($channel_desc . "</p>"); //get and output "<item>" elements $x=$xmlDoc->getElementsByTagName('item'); $i=1; // $i = 1 to n (I use For here). { $item_title=$x->item($i)->getElementsByTagName('title') ->item(0)->childNodes->item(0)->nodeValue; $item_link=$x->item($i)->getElementsByTagName('link') ->item(0)->childNodes->item(0)->nodeValue; $item_desc=$x->item($i)->getElementsByTagName('description') ->item(0)->childNodes->item(0)->nodeValue; // If i remove this, it will work....//////////// $item_content=$x->item($i)->getElementsByTagName('content') ->item(0)->childNodes->item(0)->nodeValue; ///////////////////////////////////////////////////// echo ("<p><a href='" . $item_link . "'>" . $item_title . "</a>"); echo ("<br />"); echo ($item_desc . "</p>"); echo ("<br />"); echo ($item_content . "</p>"); } ?> Please help me Fix this Code to Get content of Tag Name <content:encoded> Thanks Is it possible to have a text field on my site, and the text that is entered into it, be given to another site that I auto redirect the user to? If it is possible, could somebody give me the exact code (I'm not a programmer) I would need to use? Thanks for any help on this. Hi
I'm trying to limit the number of characters in a postcode field in wordpress gravity form. This is what I have so far but its not working.
add_filter("gform_field_validation_24_47", "custom_validation"); function custom_validation($result, $value, $form, $field){ if(!$result["is_valid"] && $result["message"] == "Enter full address."){ $zip = $value["47.5"]; if(strlen($zip) > 10) { $result["is_valid"] = false; $result["message"] = "Max 10 characters"; } } return $result; }Can anyone tell me what the issue is? Thanks! I connected to a database. i want to know how i can get the value out of that field and add it to the values of another. i don't want to make any changes to the database. i just want to use the values for coding. please, if anyone knows how to do this, let me know. I am trying to find this form field "form_key" on tumblr.com If you view source on: http://www.tumblr.com/dashboard On firefox it shows this: Code: [Select] <form style="width:0px; height:0px; overflow:hidden; position:absolute;" method="post" action="/set_avatar" id="set_avatar_form" enctype="multipart/form-data"> <input type="hidden" name="form_key" value="jg351pzpvzMSkyJIZZhkT7AfcQ"/> <input type="file" name="set_avatar" id="set_avatar" onchange="$('set_avatar_form').submit();"/> <input type="hidden" name="redirect_to" value="/dashboard"/> </form> But when I use php's file_get_content("http://www.tumblr.com/dashboard"); That data is no where to be found. Any idea how I can get that form data in my php file? For example I am trying to use regex preg_match_all to extract the form_key, but get_file_contents doesnt show the <form></form> I have a number of fields to display on a page, from a mysql query, some fields are empty, some not. depends on what they choose on the original form. I am trying to display on the form results on a page formatted using the below: If the mysql field is empty, display an unchecked check box next to the result. If there is data in the field display a check box ticked. What can i do to achieve this, can you point me in the right direction? Results page using echo: </TD><TD>Options: <input type='checkbox' CHECKED>". $row[17]. " </TD> = is not empty field </TD><TD>Options: <input type='checkbox' UNCHECKED>". $row[17]. " </TD> = emtpy ,mysql field </TD><TD>Options: <input type='checkbox' CHECKED>". $row[18]. " </TD> = not empty mysql field from query </TD><TD>Options: <input type='checkbox' UNCHECKED>". $row[18]. " </TD> = Empty field in mysql I am trying to show Rows 1 to 16 to display normally, rows 17 to 30 use the above logic. There are about 30 fields to display like this, the others are required fields and are displayed no matter what. Okay, I have a useredit page in where a user can manage their account info. All the text field and SQL connections work fine, and they all update perfectly. But when I go ahead and add my own text field (first name) and hit submit, it says success - but in my SQL it hasn't actually updated ... What the Ef? Here are my snippets of my codes: --useredit.php-- <form action="process.php" method="POST"> <input type"text" name"firstname" value="<? if($form->value("firstname") == ""){ echo $session->userinfo['firstname']; }else{ echo $form->value("firstname"); } ?>"> <input type="hidden" name="subedit" value="1"> <input type="submit" value="Edit Account"> --process.php-- function procEditAccount(){ global $session, $form; /* Account edit attempt */ $retval = $session->editAccount($_POST['curpass'], $_POST['newpass'], $_POST['email'], $_POST['firstname']); /* Account edit successful */ if($retval){ $_SESSION['useredit'] = true; header("Location: ".$session->referrer); } --session.php-- function editAccount($subcurpass, $subnewpass, $subemail, $subfirstname){ global $database, $form; if($subfirstname){ $database->updateUserField($this->username,"firstname",$subfirstname); } --database.php-- function updateUserField($username, $field, $value){ $q = "UPDATE ".TBL_USERS." SET ".$field." = '$value' WHERE username = '$username'"; return mysql_query($q, $this->connection); } If you need to see more code, let me know. Would appreciate the help, thanks! Ollie! Hi, My code below only allows me to search exact terms and therefore does not allow for spelling mistakes of names etc. Please can somebody advise how I can alter the code below to allow a user to search part of the search criteria and still retrieve results e.g. a search for "business" would return "business analysis", "business architecture" and so on. Any help would be greatly appreciated. $sql="SELECT DISTINCT First_Name, Last_Name, l.Resource_ID FROM ((resource l inner join resource_skill ln on l.Resource_ID = ln.Resource_ID) inner join skill n on ln.Skill_ID = n.Skill_ID) WHERE First_Name LIKE '$fname' OR Last_Name LIKE '$lname' OR Skill_Name LIKE '$skill'"; Thanks a lot! Paul I have a form where users can send comments. The form sends the comments to me via e-mail. Why is the e-mail field not staying "sticky" after I click "Submit" yet the other fields are?? Code: [Select] <form id="comments" action="" method="post"> <ul> <!-- Sender's Email --> <li> <label for="senderEmail">Your E-mail:</label> <input id="senderEmail" name="senderEmail" class="text" type="text" maxlength="40" value="<?php if(isset($senderEmail)){echo htmlspecialchars($senderEmail, ENT_QUOTES);} ?>" /><!-- Sticky Field --> <?php if (!empty($errors['senderEmail'])){ echo '<span class="error">' . $errors['senderEmail'] . '</span>'; } ?> </li> <!-- Subject Line --> <li> <label for="subject">Subject:</label> <input id="subject" name="subject" class="text" type="text" maxlength="80" value="<?php if(isset($subject)){echo htmlspecialchars($subject, ENT_QUOTES);} ?>" /><!-- Sticky Field --> <?php if (!empty($errors['subject'])){ echo '<span class="error">' . $errors['subject'] . '</span>'; } ?> </li> Debbie |