Using php/mysql accountify
hello i am kinda new to dreamweaver and have had sucess doing what i have wanted up until this last snag. i want to be able to have people log in to my website into their own personal account. so far accountify is the only program that allows for me to do this for free. i have gone online and created an sql database, and set the apache handler so that my website parses php. yet when i try to acess a php page, i get an error message, if anyone is familiar with accountify, or is just good with php, i would really appreciate the help, here is a link to my website www.flightswitch.com and in it, the home link is the link to the php page that wont work.
I missed the link to your site it looks like the gist of it is expressed by this part of what comes up on the page:
If no errors were reported, then Accountify is ready to use. You can log in to the administrative account now. If you do see error messages above, then you probably need to edit login_config.php and specify the right settings for your web hosting account.
Did you run the little script provided on the Accountify homepage to make sure the server supports the PEAR library?
I've installed other similar web applications like this before, and they have varying levels of pre-configuration. One little thing off and you'll get errors, so check all the pre-installation requirements and steps. When it's right, you'll know it, it will just zip though the install and you're ready to go. Sometimes there's a file or two you'll have to delete from the server or tweak, but it should tell you that. Also make sure permissions are properly set on files or folders.
As far as the errors that you're getting, they all appear to be related - so check the login-config.php files as stated. And see what sort of support they have going on at the Accountify site, these are most likely common erros and addressed in an FAQ or knwledgebase.
Similar Messages
-
Best way to update images using PHP / MySQL?
HI
I want to update images using PHP/MySQL, so users can update their images and maybe some other files but mainly images.
thanksHow messed up is this code?!
<?php
//connect to database
$con = mysql_connect("testhost","testuser","pass");
// file properies
$file = $_FILES['image']['tmp_name'];
if (!isset($file))
echo "please select an image";
else {
$id = $_REQUEST['id_display'];
$image = ($_FILES['image']['tmp_name']) ? file_get_contents ($_FILES['image']['tmp_name']) : '';
$image_name = ($_FILES['image']['name']) ? addslashes($_FILES['image']['name']): '';
$image_size = ($_FILES['image']['tmp_name']) ? getimagesize($_FILES['image']['tmp_name']): '';
if ($image_size == FALSE)
echo "You have not selected an image.";
else {
mysql_select_db("test_display", $con);
mysql_query("UPDATE testtable SET image = '$image', imagename = '$image_name' WHERE id_display='$id'");
?>
And the upload page....
/*Update code */ /*End update code */ -
CS6 Dreamweaver using PHP & MySQL - Delete Record Server Behavior?
When I try to insert the Delete Record server behavior. I get an error message about a DeleteRecord.js file, which seems to be missing or defective. I cannot use the server behavior. I have a file that I developed using CS5, and it does indeed delete the record, but does not proceed to the destination I want. I cannot change that except in the server behavior, so I'm stuck. I have noticed that server behaviors seem to disappear without apparent cause, as it seems to have in this case. I will appreciate any suggestions! Is there any way to embed a call to a target page manually? All is working WITHOUT the server behavior appearing, but I want to go to a confirmation display page that shows the record is indeed deleted, and we just return to the (now blank) delete confirmation page. That'll drive a user bonkers!
Thanks!
Delete Record in CS6 Dreamweaver using PHP & MySQL?Well, your error message is self-explanatory.
DW stores ServerBehaviors in 'Configuration' folder in installation directory. If one of the behavior JS files is missing/ corrupt, you'll see the error message you just did.
I've uploaded a functional, proper version of DeleteRecord.js onto my site for you to download. Here's the link:
http://www.sudarshan.me/adobeforum/dw/app/behavior-js/DeleteRecord.zip
Download this file, extract it and put DeleteRecord.js file in your installation directory as follows. If prompted, 'replace' your local copy:
Mac: Applications > Adobe Dreamweaver CS6 > Configuration > ServerBehaviors > PHP_MySQL
Windows: C:\Users\Your User Name\AppData\Roaming\Adobe\Dreamweaver CS6\[language]\Configuration\ServerBehaviors\PHP_MySQL
It should work as expected.
If that still doesn't solve the problem, reset your DW preferences and cache and try doing it. Follow the instructions here to reset cache: http://forums.adobe.com/thread/494811
Let us know how it goes.
-ST -
Database Connection using PHP/MySQL on OS X
I created a database connection originally on my XP machine
using Dreamweaver CS2 and everything worked as it should. I
recently switched to a Mac and CS3 and while I can see the
connection file in the Connections folder, it appears grayed out in
Dreamweaver. I tried to create a new data connection to see if that
would solve this problem, but it won't let me. I typed in all the
information and when I clicked "Test" or to browse for the
appropriate database it pops up an error message saying "An
unidentifiable error has occurred". I'm sure I could work around
this by manually coding everything, but I'm a novice in programming
and need to be able to use this feature. The worst thing about it,
is that anytime I have to make a change to the web page, even if
it's not regarding this section of code, it gets messed up. I have
made backups, but once they are opened on the Mac they are messed
up.
I'm using Dreamweaver CS3, PHP/MySQL on a remote server as I
still can't get my local web server functioning properly under
Leopard. Any help would be appreciated because I haven't been able
to find anything regarding this error online.bouldersp wrote:
> I typed in all the
> information and when I clicked "Test" or to browse for
the appropriate database
> it pops up an error message saying "An unidentifiable
error has occurred".
That usually means that something is preventing communication
between
Dreamweaver and the testing server. It could be a firewall or
anti-virus
software. In the Testing Server section of the Advanced tab
in Site
definition, Host directory and URL prefix should both point
to the same
place. The first is the physical path to the top level of
your site, the
second is the URL you enter into a browser address bar to get
to the
same location.
> I'm using Dreamweaver CS3, PHP/MySQL on a remote server
as I still can't get
> my local web server functioning properly under Leopard.
You might find this tutorial on my website helps:
http://foundationphp.com/tutorials/php_leopard.php
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Using php-mysql module and Apache2.2 provided with FMS4.5
Hi,
we've recently downloaded and upgraded FMS from 3 to 4.5 on a server that has this configuration (before upgrading):
- Centos 5.5
- Apache 2.2.3
- mysql 5.0.77
- php 5.3.3
- perl 5.8.8
Everything was fined before upgrading since 3 years.
We decided to upgrade FMS to provide HLS to our customers.
Once we upgraded FMS and installed Apache that comes with the installer, we encountered lots of errors.
- no more php, all scripts were visible, so we had to reinstall php module; and by the way, how can't we have the logical directories for apache (like /etc/httpd/,...) instead of /opt/adobe/fms/Apache...
- no more perl, cgi script are also visible...
- and now, we are unable to connect to mysql database. Whatever we do, the following message appears:
Fatal error: Call to undefined function mysql_connect()
modules are in the right folders but no way....
If someone can help us,
regards,
Tonyi answer to myself:
I finally managed to do it.
The best way was this:
- backup the Apache folders from fms
- reinstall fms w/o apache
- reinstall properly the standard httpd ( i launched yum remove httpd before)
- copy modules from fms backup to /etc/httpd/modules so i havve specific modules
- update httpd.conf with adobe version (easy with Kompare)
restart httpd and fms
Now everything works well: php, mysql, cgi, ... -
I am getting this back:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at AS3_Flash_Poll_PHP_MySQL_fla::WholePoll_1/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
PHP code:
<?php
// ---------------------------------------- Section 1 -----------------------------------------------
// IMPORTANT!!!! Connect to MySQL database here(put your connection data here)
mysql_connect("ginaty05.fatcowmysql.com","fall2010","@regina") or die (mysql_error());
mysql_select_db("poll_2010") or die (mysql_error());
// When Flash requests the totals initially we run this code
if ($_POST['myRequest'] == "load_numbers") {
// Query the totals from the database
$sql1 = mysql_query("SELECT id FROM votingPoll WHERE choice='1'");
$choice1Count = mysql_num_rows($sql1);
$sql2 = mysql_query("SELECT id FROM votingPoll WHERE choice='2'");
$choice2Count = mysql_num_rows($sql2);
$sql3 = mysql_query("SELECT id FROM votingPoll WHERE choice='3'");
$choice3Count = mysql_num_rows($sql3);
echo "choice1Count=$choice1Count";
echo "&choice2Count=$choice2Count";
echo "&choice3Count=$choice3Count";
// ---------------------------------------- Section 2 -----------------------------------------------
// IF POSTING A USER'S CHOICE
if ($_POST['myRequest'] == "store_choice") {
//Obtain user IP address
$ip = $_SERVER['REMOTE_ADDR'];
// Create local variable from the Flash ActionScript posted variable
$userChoice = $_POST['userChoice'];
$sql = mysql_query("SELECT id FROM votingPoll WHERE ipaddress='$ip'");
$rowCount = mysql_num_rows($sql);
if ($rowCount == 1) {
$my_msg = "You have already voted in this poll.";
print "return_msg=$my_msg";
} else {
$sql_insert = mysql_query("INSERT INTO votingPoll (choice, ipaddress) VALUES('$userChoice','$ip')") or die (mysql_error());
$sql1 = mysql_query("SELECT * FROM votingPoll WHERE choice='1'");
$choice1Count = mysql_num_rows($sql1);
$sql2 = mysql_query("SELECT * FROM votingPoll WHERE choice='2'");
$choice2Count = mysql_num_rows($sql2);
$sql3 = mysql_query("SELECT * FROM votingPoll WHERE choice='3'");
$choice3Count = mysql_num_rows($sql3);
$my_msg = "Thanks for voting!";
echo "return_msg=$my_msg";
echo "&choice1Count=$choice1Count";
echo "&choice2Count=$choice2Count";
echo "&choice3Count=$choice3Count";
?>
AS3 code:
stop(); // Stop the timeline since it does not need to travel for this to run
// Assign a variable name for our URLVariables object
var variables1:URLVariables = new URLVariables();
// Build the varSend variable
var varSend1:URLRequest = new URLRequest("parse_my_poll.php");
varSend1.method = URLRequestMethod.POST;
varSend1.data = variables1;
// Build the varLoader variable
var varLoader1:URLLoader = new URLLoader;
varLoader1.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader1.addEventListener(Event.COMPLETE, completeHandler1);
// Set variable to send to PHP here for the varloader below
variables1.myRequest = "load_numbers";
// Send data to php file now, and wait for response using the COMPLETE event
varLoader1.load(varSend1);
function completeHandler1(event:Event):void{
count1_txt.text = "" + event.target.data.choice1Count;
count2_txt.text = "" + event.target.data.choice2Count;
count3_txt.text = "" + event.target.data.choice3Count;
// hide the little processing movieclip
processing_mc.visible = false;
// Initialize the choiceNum variable that we will use below
var choiceNum:Number = 0;
// Set text formatting colors for errors and success messages
var errorsFormat:TextFormat = new TextFormat();
errorsFormat.color = 0xFF0000; // bright red
var successFormat:TextFormat = new TextFormat();
successFormat.color = 0x00FF00; // bright green
// Button Click Functions
function btn1Click(event:MouseEvent):void{
choiceNum = 1;
choice_txt.text = choice1_txt.text;
function btn2Click(event:MouseEvent):void{
choiceNum = 2;
choice_txt.text = choice2_txt.text;
function btn3Click(event:MouseEvent):void{
choiceNum = 3;
choice_txt.text = choice3_txt.text;
// Button Click Listeners
btn1.addEventListener(MouseEvent.CLICK, btn1Click);
btn2.addEventListener(MouseEvent.CLICK, btn2Click);
btn3.addEventListener(MouseEvent.CLICK, btn3Click);
// Assign a variable name for our URLVariables object
var variables:URLVariables = new URLVariables();
// Build the varSend variable
var varSend:URLRequest = new URLRequest("parse_my_poll.php");
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
// Build the varLoader variable
var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);
// Handler for PHP script completion and return
function completeHandler(event:Event):void{
// remove processing movieclip
processing_mc.visible = false;
// Clear the form fields
choice_txt.text = "";
choiceNum = 0;
// Load the response from the PHP file
status_txt.text = event.target.data.return_msg;
status_txt.setTextFormat(errorsFormat);
if (event.target.data.return_msg == "Thanks for voting!") {
// Reload new values into the count texts only if we get a proper response and new values
status_txt.setTextFormat(successFormat);
count1_txt.text = "" + event.target.data.choice1Count;
count2_txt.text = "" + event.target.data.choice2Count;
count3_txt.text = "" + event.target.data.choice3Count;
// Add an event listener for the submit button and what function to run
vote_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
// Validate form fields and send the variables when submit button is clicked
function ValidateAndSend(event:MouseEvent):void {
//validate form fields
if(!choice_txt.length) {
// if they forgot to choose before pressing the vote button
status_txt.text = "Please choose before you press vote.";
status_txt.setTextFormat(errorsFormat);
} else {
status_txt.text = "Sending...";
processing_mc.visible = true;
// Ready the variables for sending
variables.userChoice = choiceNum;
variables.myRequest = "store_choice";
// Send the data to the php file
varLoader.load(varSend);
} // close else after form validation
} // Close ValidateAndSend function ////////////////////////This error means that you are trying to set the text field but there is no data in the variable. As a first step, try to identify where this is happening, eg Is it the first call, or once you have submitted your data or only if you try to submit data second time?
Trace out the data that is returned for both completeHandlers to see if there is a missing var. Try this for "load_numbers" and "store_choice". Do it twice for "store_choice". Do you get back what you expected?
You could also try altering the php to return some fixed dummy variables, eg choice1Count=11&choice2Count=22&choice3Count=33, etc. If this works then you know that the error is in the PHP.
It looks to me like the issue is when you submit the data a second time and just get back the return_msg - the handler then tries to assign the choice1Count etc but doesn't have any count data back from the poll.php.
Test that there is data before assigning it, eg
if(event.target.data.choice1Count){
count1_txt.text = event.target.data.choice1Count;
count2_txt.text = event.target.data.choice2Count;
count3_txt.text = event.target.data.choice3Count; -
Using php/mysql for calculations
Hi guys,
Im experimenting with calculations on a site but im not sure whats the right way to go about it.
the result im looking for is this,,
Im setting up a personality test on the website where the questions he answers should classify him into one of 4 groups.
my thoughts are to keep it simple, every question he answers should have a +1 effect on the certain group in question and then at the end of all the questions display the result of the group that has the largest count.
now some told me i should use javascript which im not very familiar with,
others said i should be able to do the calculations in php before the result is sent to the database
but i also thought of the possibility to send all into uncalculated to the db and then just retrieve the right result,
would like to hear your opinions on this,
or if you think there is a easier way than my "+1 effect"
thanks in advance!One way would be to associate each question with a group.
Create an array with 4 elements say G(0), G(1), G(2), G(3) Set it to zero.
for question = 1 to number of questions
Ask a question
Each time a question is answered correctly, increment value of the associated array group element (1) to (4) by 1.
Until you have asked the first round of questions.
So now you have a set of values in each element. Problem is how to find the largest. Especially if you have a tie.
Sort the array to set them in order ascending- see :http://www.php.net/manual/en/function.asort.php
set $winner to the first groups reference ( this will always be 0,1 2 or 3 and should contain the winner unless there is a tie)
If the lst two elements in the sorted list are not equal
set $winner to the 1st elements reference (if its G(3) set it to 3, not the value of G(3))
else (you have a tie)
repeat
set the other two elements to zero
ask a question
increment the matching group element
sort the array
compare the values of the two top elements
until the values of two top elements are not equal
set the value of $winner to the 1st elements reference (if its G(4)set it to 4, not the value of G(4))
store $winner in your database
Hope this makes sense - it took a while to work out and it still needs coding.
The other way is to ask your questions and save them in the database as you go along. At the end of stage one, do a select all from groups, order by group value
You may then have a tie, so you would need to ask more questions as deciders and do it again.
Either way, ist an interesting project.
I'm off to bed! -
Using PHP MySQL to load data into div
I have one page with mulitple images and one hidden div. When
one of the images are selected, the hidden div will appear and the
div will be loaded with dynamic data based on the button selected.
Can anyone give me any help on how to accomplish retrieving a
database record without using a url parameter?For the image to be clicked, the page will already have been
fetched from
the server. Since server-scripting only executes on the
server, you have
missed your opportunity to use server-scripting to retrieve
the data. And
since you don't want to use a URL variable, you would have to
use a cookie
or a session variable instead.
Have the click on the image first set a cookie/session
variable containing
the information for which record to retrieve, and then reload
the same page,
which will check the value in the cookie/session variable to
load the
desired record from the database, and populate the div.
If you don't want to reload the page then you will have to
use something
like SPRY/AJAX.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"green tomato" <[email protected]> wrote in
message
news:go2n9v$op1$[email protected]..
>I have one page with mulitple images and one hidden div.
When one of the
>images
> are selected, the hidden div will appear and the div
will be loaded with
> dynamic data based on the button selected. Can anyone
give me any help on
> how
> to accomplish retrieving a database record without using
a url parameter?
> -
May be someone can help me out with this problem.
I have setup a new site using PHP MySQL and Dreamweaver 8.02.
Dreamweaver connects to the database but after creating a
recordset the recordset cannot be used.
instead Dreamweaver returns:
HTTP Error Code 500 internal Server Error
Any help will be much appriciated.
JosHello,
I have also had the same error - namely that whilst I could connect via ftp, upload/download files, and view database tables, any attempt to view of modify recordsets resulted in error 500.
Having checked other potential causes (e.g. selection/non-selection use of passive FTP setting, enabling of php, etc.), on the back of posts here I contacted my host and asked if if could relate to mod security, as further investigation revealed that the issue only occurred on sites where mod security had not been disabled (I don't like to disable mod security for obvious reasons - and I'm told you can't do that site by site with apache2 anyway).
After a few false starts, the problem was resolved - with the following response from my host: "The false positives were being generated by "/_mmServerScripts/MMHTTPDB.php" and that is what we've worked around in the rules. As such, any domain on [servername] using that script in the same way shouldn't generate a false-positive moving forward."
So it seems the answer (assuming your on an apache server of course) may be to modify the rules to allow full access for MMHTTPDB.php.
I hope that is of help to some. -
Login failure (cannot modify header) PHP/MySQL
I have a login form 100% Dreamweaver8 built using PHP/MySQL.
After logging in it fails to goto the $MM_redirectLoginSuccess page
(index.php). I did not have this issue prior to the 8.02 update. I
designed it the same way as I had before the 8.02 update. I have
checked multiple times for whitespace before and after the PHP open
and close tags in Dreamweaver and other text editors.
Below is what info is needed I hope.
Error
PHP Warning: Cannot modify header information - headers
already sent by (output started at /var/www/web4/web/login.php:4)
in /var/www/web4/web/login.php on line 72, referer:
Code (All Dreamweaver 8 Generated)
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "Account_Type";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "loginfailed.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_dnsturtle, $dnsturtle);
$LoginRS__query=sprintf("SELECT Email, Password,
Account_Type FROM accounts WHERE Email=%s AND Password=%s",
GetSQLValueString($loginUsername, "text"),
GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $dnsturtle) or
die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'Account_Type');
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
header("Location: " . $MM_redirectLoginSuccess );
--------------------Line 72
else {
header("Location: ". $MM_redirectLoginFailed );
?>I take it you have an include file as well on the page, to
reference the
database? Check in there for whitespace.
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete
Login system. -
I've posted this before and didn't get the answer that I need, probably because I didn't post all of my codes. I am using PHP/MySql. I created a website that has several forms. When I process three of the forms, I get the error messages below:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Condition, Length, Color, City, `State`, Email, Photo) VALUES ('29', '4', 'Used'' at line 1.
Below I am posting the codes. Hopefully, this time I posted everything that I should have so that I can get assistance.
FORM
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
<table width="594" border="0" class="test">
<tr></tr>
<tr>
<td width="166" class="td">Posting Title</td>
<td colspan="3"><span id="sprytextfield1">
<label>
<input name="Posting Title" type="text" class="test" id="Posting Title" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
</tr>
<tr>
<td class="td">Price</td>
<td colspan="3"><span id="sprytextfield2">
<label>
<input name="price" type="text" class="test" id="price" size="35" />
</label>
<span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td class="td">Size(s)</td>
<td colspan="3"><label>
<select name="size" size="1" multiple="multiple" class="test" id="size">
<option>0</option>
<option>2</option>
<option>4</option>
<option>6</option>
<option>8</option>
<option>10</option>
<option>12</option>
<option>14</option>
<option>16</option>
<option>18</option>
<option>20</option>
<option>22</option>
<option>24</option>
<option>26</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Condition</td>
<td colspan="3"><label>
<select name="Condition" class="test" id="Condition">
<option>New</option>
<option>Used</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Length</td>
<td colspan="3"><label>
<select name="Length" class="test" id="Length">
<option>Long</option>
<option>Short</option>
<option>Mid-Length</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Color</td>
<td colspan="3" class="td"><span id="sprytextfield5">
<label>
<input name="Color" type="text" class="test" id="Color" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
</tr>
<tr>
<td class="td">City</td>
<td class="td"><span id="sprytextfield4">
<label>
<input name="City" type="text" class="test" id="City" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
<td class="td"> </td>
<td class="td"> </td>
</tr>
<tr>
<td class="td">State</td>
<td colspan="3"><label>
<select name="State" class="test" id="State">
<option>AL</option>
<option>AK</option>
<option>AZ</option>
<option>AR</option>
<option>CA</option>
<option>CO</option>
<option>CT</option>
<option>DE</option>
<option>DC</option>
<option>FL</option>
<option>GA</option>
<option>HI</option>
<option>ID</option>
<option>IL</option>
<option>IN</option>
<option>IA</option>
<option>KS</option>
<option>KY</option>
<option>LA</option>
<option>ME</option>
<option>MD</option>
<option>MA</option>
<option>MI</option>
<option>MN</option>
<option>MS</option>
<option>MO</option>
<option>MT</option>
<option>NE</option>
<option>NV</option>
<option>NH</option>
<option>NJ</option>
<option>NM</option>
<option>NY</option>
<option>NC</option>
<option>ND</option>
<option>OH</option>
<option>OK</option>
<option>OR</option>
<option>PA</option>
<option>RI</option>
<option>SC</option>
<option>SD</option>
<option>TN</option>
<option>TX</option>
<option>UT</option>
<option>VT</option>
<option>VA</option>
<option>WA</option>
<option>WV</option>
<option>WI</option>
<option>WY</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Email</td>
<td colspan="3"><span id="sprytextfield3">
<label>
<input name="Email" type="text" class="test" id="Email" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td height="26" class="td">Confirm Email</td>
<td colspan="3"><span id="spryconfirm1">
<label>
<input name="Confirm Email2" type="text" class="test" id="Confirm Email2" size="35" />
</label>
<span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
</tr>
<tr>
<td height="26" class="td">Photo(s)</td>
<td colspan="3"><label>
<input name="Photo" type="file" class="test" id="Photo" size="35" />
</label></td>
</tr>
<tr>
<td height="131" class="td">Additional Details</td>
<td colspan="3"><label>
<textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
</label></td>
</tr>
</table>
<p>
<label>
<input name="Submit" type="submit" class="test" id="Submit" value="Post" />
</label>
</p>
<input type="hidden" name="MM_insert" value="individual" />
</form>
SERVER BEHAVIOR
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
$insertSQL = sprintf("INSERT INTO donations (postingTitle, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Posting Title'], "text"),
GetSQLValueString($_POST['size'], "text"),
GetSQLValueString($_POST['Condition'], "text"),
GetSQLValueString($_POST['Length'], "text"),
GetSQLValueString($_POST['Color'], "text"),
GetSQLValueString($_POST['City'], "text"),
GetSQLValueString($_POST['State'], "text"),
GetSQLValueString($_POST['Email'], "text"),
GetSQLValueString($_POST['Photo'], "text"));
mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
$Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
$insertGoTo = "donations.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
DATABASE CONNECTION
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_bridesmaidsrack_db = "localhost";
$database_bridesmaidsrack_db = "bridesmaidsrack";
$username_bridesmaidsrack_db = "";
$password_bridesmaidsrack_db = "";
$bridesmaidsrack_db = mysql_pconnect($hostname_bridesmaidsrack_db, $username_bridesmaidsrack_db, $password_bridesmaidsrack_db) or trigger_error(mysql_error(),E_USER_ERROR);Hi David,
I did as you recommended. For good measure, I even changed the case of the letters to make sure that they coincide with exactly what's in the database. I still kept getting the same error message. So I deleted the recordset and attempted to recreate it. When I attempted to recreate the record set, I got the following error message: "RangeError: invalid array length". My codes are listed below:
Form:
<form method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
<table width="594" border="0" class="test">
<tr></tr>
<tr>
<td width="166" class="td">Posting Title</td>
<td colspan="3"><span id="sprytextfield1">
<label>
<input name="posting_title" type="text" class="test" id="posting_title" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
</tr>
<tr>
<td class="td">Size(s)</td>
<td colspan="3"><label>
<select name="size" size="1" multiple="multiple" class="test" id="size">
<option>0</option>
<option>2</option>
<option>4</option>
<option>6</option>
<option>8</option>
<option>10</option>
<option>12</option>
<option>14</option>
<option>16</option>
<option>18</option>
<option>20</option>
<option>22</option>
<option>24</option>
<option>26</option>
</select>
<span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td>
</tr>
<tr>
<td class="td">Condition</td>
<td colspan="3"><label>
<select name="condition" class="test" id="condition">
<option>New</option>
<option>Used</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Length</td>
<td colspan="3"><label>
<select name="length" class="test" id="length">
<option>Long</option>
<option>Short</option>
<option>Mid-Length</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Color(s)</td>
<td colspan="3" class="td"><span id="sprytextfield5">
<label>
<input name="color" type="text" class="test" id="color" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
</tr>
<tr>
<td class="td">City</td>
<td class="td"><span id="sprytextfield4">
<label>
<input name="city" type="text" class="test" id="city" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span></span></td>
<td class="td"> </td>
<td class="td"> </td>
</tr>
<tr>
<td class="td">State</td>
<td colspan="3"><label>
<select name="state" class="test" id="state">
<option>AL</option>
<option>AK</option>
<option>AZ</option>
<option>AR</option>
<option>CA</option>
<option>CO</option>
<option>CT</option>
<option>DE</option>
<option>DC</option>
<option>FL</option>
<option>GA</option>
<option>HI</option>
<option>ID</option>
<option>IL</option>
<option>IN</option>
<option>IA</option>
<option>KS</option>
<option>KY</option>
<option>LA</option>
<option>ME</option>
<option>MD</option>
<option>MA</option>
<option>MI</option>
<option>MN</option>
<option>MS</option>
<option>MO</option>
<option>MT</option>
<option>NE</option>
<option>NV</option>
<option>NH</option>
<option>NJ</option>
<option>NM</option>
<option>NY</option>
<option>NC</option>
<option>ND</option>
<option>OH</option>
<option>OK</option>
<option>OR</option>
<option>PA</option>
<option>RI</option>
<option>SC</option>
<option>SD</option>
<option>TN</option>
<option>TX</option>
<option>UT</option>
<option>VT</option>
<option>VA</option>
<option>WA</option>
<option>WV</option>
<option>WI</option>
<option>WY</option>
</select>
</label></td>
</tr>
<tr>
<td class="td">Email</td>
<td colspan="3"><span id="sprytextfield3">
<label>
<input name="email" type="text" class="test" id="email" size="35" />
</label>
<span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td height="26" class="td">Confirm Email</td>
<td colspan="3"><span id="spryconfirm1">
<label>
<input name="confirm_email2" type="text" class="test" id="confirm_email2" size="35" />
</label>
<span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
</tr>
<tr>
<td height="26" class="td">Photo(s)</td>
<td colspan="3"><label>
<input name="Photo" type="file" class="test" id="Photo" size="35" />
</label></td>
</tr>
<tr>
<td height="131" class="td">Additional Details</td>
<td colspan="3"><label>
<textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
<input name="hiddenField" type="hidden" id="hiddenField" value="Date" />
</label></td>
</tr>
</table>
<p>
<label>
<input name="Submit" type="submit" class="test" id="Submit" value="Post" />
</label>
</p>
</form>
Server Behavior
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
$insertSQL = sprintf("INSERT INTO donations (posting_title, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['posting_title'], "text"),
GetSQLValueString($_POST['size'], "text"),
GetSQLValueString($_POST['condition'], "text"),
GetSQLValueString($_POST['length'], "text"),
GetSQLValueString($_POST['color'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['state'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['Photo'], "text"));
mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
$Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
$insertGoTo = "donations.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo)); -
PHP/mySQL code help please
Hi all,
Thanks to David Powers fab tutorial I am now well on my way to competeing my first dynamique website using PHP/mySQL, (thanks David ), however I am stuck on one particular area....can anyone please help?
I know that the mySQL database uses the format YYYY/MM/DD for dates, and that is fine. I've sorted out how to display in a more regular format (eg. 1st September 2011) for my application, but I am stuck on how to convert a more regular formatted date entered by the site user into the mySQL format.
Ideally I would like for the users entry or say either 1/9/11 or 1-9-11 (or something along those lines, to be recognised and displayed on the entry form, but to have a backend function that converts the data to mySQL format. I seem to be reading plenty of forum posts which say this can be done, but unfortunately I can't quite seem to fathom how, or where the code should sit. Would someone mind taking a look at my code page to actually identify what I need to insert, and equally as importantly...where!!!
Along these lines...is it possible to have a mini-calendar date picker that could be embedded next to the date entry field to ensure that a valid date is entered and in the correct format? Where could this be sourced?
Thanks in advance of some much needed help
MarkThis is becoming really frustrating for me (so god knows how I am to you!!!!), but I usually pick things up so fast and yet this whole PHP/SQL thing is eluding me!!
I can see (I think) how the code would work, but am struggling to see where it fits into place with my own Dreamweaver 'Update Record' code, as follows. I have spent a couple of days trawling through PHP.net and various other sites and forums before bringing my stupidity to the public domain, but I just can't seem to crack it.
This one last time then i'll leave you in peace??????
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE gig_guide SET `date`=%s, town=%s, venue=%s, private_or_public=%s, start_time=%s WHERE `index`=%s",
GetSQLValueString($_POST['date'], "date"),
GetSQLValueString($_POST['town'], "text"),
GetSQLValueString($_POST['venue'], "text"),
GetSQLValueString($_POST['type'], "text"),
GetSQLValueString($_POST['start_time'], "text"),
GetSQLValueString($_POST['index'], "int"));
mysql_select_db($database_online, $online);
$Result1 = mysql_query($updateSQL, $online) or die(mysql_error());
$updateGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $updateGoTo));
$colname_updatePost = "-1";
if (isset($_GET['index'])) {
$colname_updatePost = $_GET['index']; -
i have beee recently given a project on creating a technical discussion forum using php/mysql . i dont have prior knoweledge of these topic
si if you can help me to get the required coding and a overalll overview about creating it i shall be thankful to you. my e mail id is [email protected] if you can send it personally to mei have beee recently given a project on creating a
technical discussion forum using php/mysql . i
dont have prior knoweledge of these topic
si if you can help me to get the required coding and a
overalll overview about creating it i shall be
thankful to you. my e mail id is
[email protected] if you can send it personally
to me
What has this to do with Java/Swing ?? -
PHP MySQL NULL Values ??
Hi,
I am trying to implement a CMS in Dreamweaver MX 2004 using
PHP MySQL. My Product table contains fields that are not relavent
to all products and at the moment i have given these the value
NULL. Is there anyway for dreamweaver not to display the NULL
fields or is my problem with the database.
Thanks for any help,
IanOn Sun, 22 Oct 2006 16:53:07 +0000 (UTC), "irl_123"
<[email protected]> wrote:
>Hi,
> I am trying to implement a CMS in Dreamweaver MX 2004
using PHP MySQL. My
>Product table contains fields that are not relavent to
all products and at the
>moment i have given these the value NULL. Is there anyway
for dreamweaver not
>to display the NULL fields or is my problem with the
database.
> Thanks for any help,
> Ian
Something like this:
if (!is_null(your recordset field here)) {
//show the recordset field
Steve
steve at flyingtigerwebdesign dot com -
PHP / MySQL / Stored Procedures
I'm trying to call a stored procedure on my site which uses
php / mySQL 5.x. I've got the procedure working in the database so
that when I call it from within a MySQL client it executes and
returns the results I need, but Dreamweaver doesn't even "see" the
stored procedure.
By this I mean If I use the recordset wizard, go to advanced,
select the relevant database and then expand the Stored Procedures
tab none are listed.
Searching through Adobe help, it lists nothing about Stored
Procedures with PHP/MySQL apart from that MySQL doesn't support
them. The later versions of MySQL do support Stored Procedures, but
has anyone got them working with Dreamweaver? If so how!??!!
Any help much appreciated.Talk Rowing wrote:
> Well thanks for setting me straight - even if you are
the bearer of bad news.
> I've filed a feature request as you suggested. Can't
believe Adobe don't offer
> this.
Stored procedures have been available in MySQL only since
version 5.0,
which was released in October 2005, one month after
Dreamweaver 8. It
would have been nice to include support for stored procedures
in CS3,
but no new functionality was added to any of the server-side
features of
Dreamweaver. I have my fingers crossed for next time.
> On another note I don't suppose you could point me in
the direction of some
> tutorials on how to create a recordset from a stored
procedure manually? I've
> tried google and not come across a lot...
My server doesn't support MySQL 5.0, so apart from the
information in
the MySQL documentation, I don't know a great deal about
using stored
procedures:
http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html
One of the problems is that many hosting companies are still
using older
versions of MySQL (a lot still offer only 3.23). I'm
currently in the
process of moving to a new server with support for both PHP 5
and MySQL
5.0. Once I've had time to experiment, I hope to know a lot
more.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Maybe you are looking for
-
SRKIM:R12:AP: IMPORT 를 수행 하여 INVOICE 생성 시 DISTRIBUTION LEVEL 의 DFF 값이 생성 안됨
PROBLEM R12.0.5: Payables Module 에서 Payables Open Interface Import Process (APXIIMPT) 를 통해 invoice 생성 시 distribution level 의 DFF 정보를 interface table 에 load 하였으나 실제 invoice 생성 시에는 해당 값들이 invoice table 로 넘어 오지 않았다. SOLUTION 해당 ISSUE 는 Bug 6837035 R12 :
-
Getting Err : An error occurred in the message processing program.
Hi, Im wrking with Smartforms. I have assigned output type LD00 ,with driver prgrm name and Smf name. after that executing with VL03N , its giving error . Output could not be issued Message no. VL086 Diagnosis An error occurred in the message process
-
IWeb not looking good on Internet Explorer
Hi, My site, www.bargelachouette.com has sat well on mac and in Windows IE for a couple of years, except for a small glitch on IE which I was prepared to accept. A few days ago I upgraded to IE8 on the Windows virtual machine of Parallels. The site i
-
Missing Panels in all three Edit Modes (Mac -- PSE 8)
Hello: Anyone have any ideas on this? Installed PSE 8 on my MacBook tonight, and thanks to this forum I've been able to troubleshoot a couple of glitches. But this one has me stumped. When i select any of the three edit options on the right side of t
-
Ordering a photo book in Elements11
How do you order a photo book that has been created and saved? Only prints are offered as a selection. Do I have to export the images to iPhoto to get this done or is it still possible to order it with Shutterfly via Elements. Frustrating!