PHP script...where do I put my variables???
I'm working on a PHP script and I've got the fill in parts working but just cannot get my head around the drop down menu and radio buttons. I tried typing in the drop down menu pieces in the "$body" part of it but then all it did was send me everything. If the sender only wants one thing from the drop down menu, I only want to see what the customer wanted. Not what is in all the menu. From email to phone seems to work good but I guessed at the pull down "service menu" and also the Name through Comments works in the body portion as well but those pull down and radio parts are not sending. I don't even know what an EOD is and what to type in there or the results part as well. Please help!!
<?php
/* Email Variables */
$emailSubject = 'contactformprocess.php';
$webMaster = '[email protected]';
/* Data Variables */
$email = $_POST['email'];
$name = $_POST['name'];
$comments = $_POST['comments'];
$phone = $_POST['phone'];
$service = $_POST['Web Design'];
$budget = $_POST['RadioGroup1_0'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Phone: $phone <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="2;URL=http://thegoldenspindle.com/Contact.html">
<style type="text/css">
Ok, here's the full script: and the contact page is http://thegoldenspindle.com/Contact.html The red is what I added that makes the whole script not send or work. I take them out and the script works again.
<?php
/* Email Variables */
$emailSubject = 'contactformprocess.php';
$webMaster = '[email protected]';
/* Data Variables */
$email = $_POST['email'];
$name = $_POST['name'];
$comments = $_POST['comments'];
$phone = $_POST['phone'];
$service = $_POST['service'];
$budget = $_POST['budget'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Phone: $phone <br>
Service: $service <br />
Budget: $budget <br />
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="2;URL=http://thegoldenspindle.com/Contact.html">
<style type="text/css">
<!--
body {
background-color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fec001;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
-->
</style>
</head>
<div align="center">Thank you for your email. You will be contacted a soon as possible!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
OK, here is my Contact Page script as well if this helps.
<!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="text/html; charset=ISO-8859-1" />
<title>Contact The Golden Spindle</title>
<style type="text/css">
<!--
body {
background-color: #000;
background-image: url(Background-BLACK.jpg);
background-repeat: repeat;
margin-left: 0%;
margin-right: 0%;
margin-top: 0%;
margin-bottom: 0%;
body,td,th {
font-size: x-small;
color: #FFF;
a:link {
color: #E8E8E8;
margin: 0px;
text-decoration: none;
a:visited {
text-decoration: none;
color: #E8E8E8;
a:hover {
color: #9DF99B;
cursor: auto;
filter: Invert;
text-decoration: none;
a:active {
text-decoration: none;
color: #930;
.style32 {
font-size: x-large;
text-transform: none;
.style33 {
font-size: large;
font-family: Arial, Helvetica, sans-serif;
.style35 {
font-family: Arial, Helvetica, sans-serif;
color: #FFF;
.style36 {font-size: small; font-family: Arial, Helvetica, sans-serif; }
.style39 {font-size: small}
.style47 {font-size: x-large;
color: #c7a317;
.style48 {font-size: large;
font-family: Arial, Helvetica, sans-serif;
color: #BBBBBB;
.style49 { color: #c7a317;
font-size: small;
.style153 {
font-size: 14px;
color: #F2E69A;
font-family: Arial, Helvetica, sans-serif;
.style154 {
font-size: 15px;
color: #F2E69A;
font-family: Arial, Helvetica, sans-serif;
.style157 {color: #726D49}
.style158 {font-size: 12px}
.style159 {font-family: Arial, Helvetica, sans-serif; color: #F2E69A;}
.style40 {color: #BBBBBB}
.style56 {color: #F2E69A}
.style65 {font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
font-style: italic;
#MenuBar1 li .goldensettings.MenuBarItemSubmenu .goldensettings {
font-size: 16px;
#MenuBar1 li .MenuBarSubmenuVisible li {
font-size: 0px;
#MenuBar1 li .MenuBarSubmenuVisible li {
font-size: 16px;
color: #3CC;
#y {
font-size: 0px;
#box {
font-size: 2px;
#Box2 {
font-size: 2px;
#box3 {
font-size: 2px;
#box4 {
font-size: 2px;
#box5 {
font-size: 2px;
#box6 {
font-size: 2px;
#box7 {
font-size: 2px;
#box8 {
font-size: 2px;
#box9 {
font-size: 2px;
#box10 {
font-size: 2px;
#box11 {
font-size: 1.2px;
#box12 {
font-size: 1.2px;
#box14 {
font-size: 1.2px;
#box16 {
font-size: 1.2px;
#box17 {
font-size: 1.2px;
#box18 {
font-size: 1.2px;
#box20 {
font-size: 1.2px;
#box21 {
font-size: 1.2px;
#box22 {
font-size: 1.2px;
#bx1 {
font-size: 5x-small;
#x {
font-size: 1px;
#x1 {
font-size: 1px;
#bx3 {
font-size: 1px;
#bx6 {
font-size: 1px;
#bx6 {
font-size: 1px;
#bx7 {
font-size: 1px;
#bx8 {
font-size: 1px;
#bx9 {
font-size: 1px;
#MenuBar1 li .MenuBarSubmenuVisible li a {
font-family: Arial, Helvetica, sans-serif;
#MenuBar1 li .MenuBarSubmenuVisible li a {
font-family: Arial, Helvetica, sans-serif;
#MenuBar1 li a {
font-family: Arial, Helvetica, sans-serif;
-->
</style>
<style type="text/css">
<!--
.style351 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
<style type="text/css">
<!--
.style156 {font-size: 15px;
color: #F2E69A;
font-family: Arial, Helvetica, sans-serif;
.none {
color: #CCC;
-->
</style>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>
<body link="#33CC66" alink="#FFFFFF">
<blockquote>
<blockquote>
<table width="547" border="0" align="center">
<tr>
<th width="541" height="93" bordercolor="#000000" scope="col"><div align="left" class="style32">
<table width="541" height="68" border="0" align="center" cellspacing="0" bordercolor="0">
<tr>
<th width="531" height="66" scope="col"><img src="Golden-Spindle-LOGO.png" width="512" height="218" /></th>
</tr>
</table>
</div></th>
</tr>
</table>
</blockquote>
</blockquote>
<table width="1073" height="40" border="1" align="center" cellspacing="0" bordercolor="#1F252D" background="Blue-Bar-Flame008.png">
<tr>
<th width="1067" height="36" align="center" valign="middle" scope="col"><table width="912" border="0" align="center">
<tr>
<td width="906" align="center" scope="col"><ul id="MenuBar1" class="MenuBarHorizontal">
<li>
<div align="center"><a href="index.html">HOME</a></div>
</li>
<li><a href="#" class="MenuBarItemSubmenu">SERVICES</a>
<ul>
<li><a href="#" class="MenuBarItemSubmenu">3D Texturing</a>
<ul>
<li><a href="3D Texturing.html">Stills</a></li>
<li><a href="Electroplating.html">Electroplating</a></li>
<li><a href="Hologram.html">Holograms</a></li>
</ul>
</li>
<li><a href="3D Composite.html">3D Composite</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Water</a>
<ul>
<li><a href="Ocean.html">Ocean</a></li>
<li><a href="Fluid Reactions.html">Fluid Reactions</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">2D Work</a>
<ul>
<li><a href="Composites.html">Composite</a></li>
<li><a href="Face Morphing.html">Face Replacement</a></li>
<li><a href="Photo Restore.html">Photo Restoring</a></li>
<li><a href="Touchups.html">Touch Ups</a></li>
<li><a href="2D Animation.html">2D Animation</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Visual Effects</a>
<ul>
<li><a href="Chroma Key.html">Chroma Key</a></li>
</ul>
</li>
<li><a href="Video Editing.html" class="goldensettings">Video Editing</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Cloth & Materials</a>
<ul>
<li><a href="Flag Blowing.html">Flag</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Ad Design</a>
<ul>
<li><a href="Brochures.html">Brochures</a></li>
<li><a href="Magazine.html">Magazine</a></li>
<li><a href="Box Design.html">Box & Print</a></li>
<li><a href="Infomercial.html">Infomercials</a></li>
</ul>
</li>
<li><a href="Logos.html">Company Logos</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Planets & Space</a>
<ul>
<li><a href="Earth.html">Earth</a></li>
<li><a href="Planets & Space.html">Moon</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Camera Techniques</a>
<ul>
<li><a href="Nasa Cam.html">NASA cam</a></li>
<li><a href="Hand Cam earth.html">Hand Cam</a></li>
</ul>
</li>
<li><a href="Graphics & Webdesign.html">Web Design</a></li>
<li><a href="Business Cards.html">Business Cards</a></li>
</ul>
</li>
<li><a href="REEL.html">DEMO REEL</a></li>
<li><a href="Graphics & Webdesign.html">WEB DESIGN</a></li>
<li><a href="Animation.html">ANIMATION</a></li>
<li><a href="Contact.html">CONTACT ME</a></li>
</ul></td>
</tr>
</table></th>
</tr>
</table>
<br />
<table width="1073" border="0" align="center" cellspacing="0">
<tr>
<td align="right"><img src="Labels-Contact-video.png" alt="" width="497" height="19" /></td>
</tr>
</table>
<br />
<br />
<form id="form2" name="form2" method="post" action="contactformprocess.php">
<table width="1166" height="167" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td width="211" align="right"><label for="name">Name:</label></td>
<td width="933"><input name="name" type="text" id="name" size="35" maxlength="80" /></td>
</tr>
<tr>
<td align="right"><label for="email2">Email:</label></td>
<td><input name="email" type="text" id="email2" size="35" maxlength="90" /></td>
</tr>
<tr>
<td height="25" align="right"><label for="phone">Phone:</label></td>
<td><input name="phone" type="text" id="phone" size="35" maxlength="12" /></td>
</tr>
<tr>
<td height="22" align="right"><label for="Service Needed:">Service Needed:</label></td>
<td><input name="Service Needed:" type="text" id="Service Needed:" size="35" maxlength="35" /></td>
</tr>
<tr>
<td height="4" align="right">Budget:</td>
<td><input name="Budget:" type="text" id="Budget:" size="35" maxlength="50" /></td>
</tr>
<tr>
<td height="5" align="right"><label for="comments">Comments:</label></td>
<td><textarea name="comments" id="comments" cols="33" rows="5"></textarea></td>
</tr>
<tr>
<td height="13" align="right"><label for="clear"></label>
<input type="reset" name="clear" id="clear" value="Reset Form" /></td>
<td align="left"><label for="submit"></label>
<input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
<tr>
<td> </td>
<td align="right"> </td>
</tr>
</table>
</form>
<p><br />
</p>
<table width="391" height="20" border="0" align="center" bordercolor="#000000">
<tr>
<th width="381" scope="col"><div align="left" class="style351">
<div align="center"><a href="About me.html">About Me</a><a href="REEL.html"></a> | <a href="Graphics & Webdesign.html">Graphic & Web Design</a> | <a href="Animation.html">Animation</a> | <a href="Video Editing.html">Video Editing</a> | <a href="Resume Video.pdf">Video Resume</a></div>
</div></th>
</tr>
</table>
<table width="422" height="36" border="0" align="center" bordercolor="#000000">
<tr>
<th width="412" height="30" scope="col"><div align="left" class="style351">
<div align="center"><span class="style40"><a href="Contact.html">Contact</a> | Leavenworth, KS | [email protected]<br />
</span></div>
<span class="style40">
<label></label>
</span>
<div align="center" class="style40">© 2009 The Golden Spindle, LLC. All Rights Reserved. </div>
</div></th>
</tr>
</table>
<p> </p>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>
Similar Messages
-
Does SQL Developer has login.sql script where I can put all the env SQLs?
Hello community,
Please help me out with a simple question.
Each time I start SQL Developer (3.1) and connect to a database I need to run:
alter session set nls_date_format='YYYY.MM.DD HH24:MI:SS';
to set data fields format to reflect hours, minutes and seconds.
Can I automate it? I use login.sql in SQL Plus tro setup environment including data formant .
How to do it in SQL Dev?
Thank you in advance,
YuryHi Yury,
You have a choice:
1. Specify the login script via Tools|Preferences|Database|Filename for the connection startup script.
2. Specify the value of nls_date_format directly via Tools|Preferences|NLS|Date Format (and perhaps additionally the Timestamp formats).
Recall that not all SQL*Plus commands are supported by Worksheet, but alter session does in fact work just fine.
Regards,
Gary
SQL Developer Team -
A question about variables and where I should put them!
Hi, I'm fairly new to java. I'm a first year computer scientist and I'm struggling with where I should put my variables.
So far on the course I've been able to wing it as we have not been doing object orientated programming, it was more like programming in fortran!
Anyway if you look at the code below, I need the variables 'speed', 'distance', 'time' and 'tottime', to be calculated in my seperate methods, but then called in my main part to be printed out; however I have no idea where I put them to get this to work!
The program is by no means complete, it's still a work-in-progress, but I need to get this sorted before I continue.
Thanks in advance
///// LogName: gxm07u
///// FullName:
///// CreationDate: 2007-11-07 09:30:07
import java.io.*;
public class travel {
public static void printMenu()
System.out.println("Travel Program\n\nn: Enter a journey\ns: Get complete journey stats\nd: Get Distance travelled stats\nq: quit");
public static void RoadMenu()
System.out.println("Type the road type:\nType m: Motorway\nType a: A road\nType b: B road\nType u: Urban road");
public static void enterRoadType()
char choice;
choice = UserInput.readChar();
switch(choice)
case 'm': //motorway
case 'M':
speed = 85;
break;
case 'a': // a road
case 'A':
speed = 70;
break;
case 'b': //b road
case 'B':
speed = 55;
break;
case 'u': // Urban road
case 'U':
speed = 40;
break;
public static void enterDistance()
System.out.println("Type the travel distance: ");
distance = UserInput.readDouble();
public static void calcTime()
time = speed/distance; // time in hours
tottime = tottime + time; //total time in hours
public static void main(String[] argv) {
int speed = 0;
double distance = 0;
double time=0, tottime=0;
} // end of main
} // end classYour calcTime() can't see variables local to other methods you either need to make them global or pass them in as parameters. To make them global:
public class travel {
int speed = 0;
double distance = 0;
double time=0, tottime=0;
public static void printMenu()also you're main method should create a instance of the class
public static void main(String[] argv) {
new travel();
}BTW it's convention to make class names begin with a uppercase letter. Also, look at using the equalsIgnoreCase() for your switch statement as it could save you 4 cases.
Hope this helps -
i just did a PHP script for a web form, it works fine that
when i press submit, it displays the page said "thanks for
submitting," but the problem is i never receive the email of the
data, any idea?I agree with GarryCT that you should try a simple test (no
HTML) to see
if you can send mail at all. If that succeeds, then try
building it up
to the point you're hoping for.
When sending HTML mail, you /might/ want to consider
including a plain
text version and sending multi-part email.
Anyway, here are some comments I have for the code posted
here:
Try
temporarily turning on display errors.
> <?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
> /*subject and email variables*/
> $subject = 'php scripting';
> $me = 'my email';
> /*gathering data variables*/
> $name1 = $_POST ['name1'];
> $name2 = $_POST ['name2'];
> $email = $_POST ['email'];
> $company = $_POST ['company'];
> $brief = $_POST ['brief'];
>
> $body = <<<EOD
> <br><HR><br>
> First Name: $name1 <br>
> Last Name: $name2 <br>
> E-mail Address: $email <br>
> Company: $company <br>
> Brief: $brief <br>
> EOD;
Hopefully, that indent was caused by the Web forum.
Otherwise, EOD;
should be at the very start of the line - no white space[1].
EOD;
> $headers = "From: $mail\r\n";
You have not assigned a value to $mail. Some hosts require
this to be
an address in your domain. Try using your $me variable here
(assuming
it is a valid email address from this domain).
> $headers .= "Content-type: text /html\r\n";
Try removing that extra space. You might also need to add
mime
version[2]. Does order make a difference? Try this for the
$headers
variable:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' .
"\r\n";
$headers .= "From: $me\r\n";
> $success = mail($me, $subject, $body, $headers);
You are not acting on the TRUE/FALSE result stored in
$success.
Everything after this point assumes mail was accepted for
delivery. Of
course, TRUE does not necessarily mean the mail actually got
to its
intended destination[2], FALSE does indicate that it was not
delivered
at all.
> /*results rendered as HTML*/
> $theResults = <<<EOD
> <!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="text/html;
charset=utf-8" />
> <title>Untitled Document</title>
> </head>
> <body>Thanks for your time, we'll get back to you
within a day.
> </body>
> </html>
> EOD;
Hopefully, that indent was caused by the Web forum.
Otherwise, EOD;
should be at the very start of the line - no white space[1].
EOD;
> echo "$theResults";
> ?>
[1]
http://php.net/echo (see "here
document" in examples.)
[2]
http://php.net/function.mail
Mark A. Boyd
Keep-On-Learnin' :) -
Retrieving a session variable from a php script and putting it in an applet
I have a chat applet and i'm trying to have a session variable in one my php scripts be setted onto the user area of my chat. Would it start out by doing this?
<object codetype="application/java"
code = "ClientApplet.class"
width = "300"
height = "400"
classid = "the name of the session variable">
</object>No.
Use the parameter tags. -
Passing variable to PHP script
Hi,
I'm new to Oracle&APEX...
I would like to upload a file to server filesystem, but I could not fid a way this to be done via APEX?
(I somebody can give me a solution You are welcome)
I know how this could be done in PHP so I created a script, but I need then to confirm to the database that the file is uploaded. To do this I need to have variable transferred to my PHP script.
I've tried to build a button to pass the value with ?var=:P5_value, but only "P%_value" is passed as text not the value of this variable.
How this can be done?
Any suggestions?Hello,
You should use the webdav functionality in XE.
http://daust.blogspot.com/2006/03/where-are-images-of-application.html
then you get the best of both worlds you get files in the database but they can be accessed as if they are in the filesystem.
Note: APEX need to be replaced with HTMLDB for Oracle XEI have no idea what you are saying here, HTMLDB and APEX are the same thing.
Carl -
Where do I put my Action Script?
So, I created a small Flash site with no loading of external
swfs. I am strictly using the timeline using labels. I have a layer
for my main buttons (home, portfolio and timeline). I have selected
AS3 for the file and I have those buttons working fine.
I have a button for my portfolio where thumbnails will pop up
after being pressed. I want to link those thumbnails to the URL's
of the actual websites. Where do I put the action script?
I also want to have my email at the bottom of the screen so
you can click on it to email me. I am used to using AS2 whwere you
simply put the code on the button.
Thanks,
GabeHey, so thank you for the fast reponse. I totally agree with
you on learning AS3, I don't want to go back to AS2.
I already have the code you supplied so I understand what it
is doing but my question is where do I put it in this case? I
always create an action layer as you mention. In my action layer, I
have frame 1 with my preloader code and then frame 2 with my code
for my main buttons. They call to the labels. So, when I press
portfolio for example, it goes to that label.......a shape tween
starts and my portfolio thumbs appear. I then want those thumbs to
link to the URL of those sites.
So, where do I stick your code?
Thanks again for all your help. I am NEW to AS3 and this is
great learning.
Thanks,
Gabe -
Where to put xsl:variable definition
I apologize in advance if this is a really obvious question/answer for most of you.
I want to use this definition code to create a variable called color:
*<xsl:variable name="color" select="'red'"/>*
I want to include this code in my RTF template to display the contents of that variable:
*<?$color?>*
My question is this: where do I put the definition code? I've tried it in several different places, none of which have worked: at the top of my RTF template, on the top row of the table where I'm referring to it, and so forth.
When I run the preview, I get the typical error screen with this key line: Variable not defined: 'color'.The subtemplate idea works quite well (mostly).
In my subtemplate, I defined this:
<?template:Format1?>
<?if:number(Sales) gt 1000000?><?attribute@incontext:color;'red'?> <?attribute@incontext:font-weight; 'bold'?><?end if?>
<?end Format1?>
In my template field, I call Format1 like this:
<?call@inlines:Format1?><?end call?>
Sure enough, my values are shown in bold red. Yay!!!
But now I've got extra vertical space in the affected cells. I've used table functions to align the values at the bottom of the cell. If I don't apply this conditional formatting, the row is what I'll call a "normal" height. When I apply the conditional formatting, the bold red numbers are displayed at the bottom of the cell as expected, but the row is twice as tall as its "normal" height.
The difference is found in the page source for the browser page. The <tr> tag shows a height of 13.216pt for the "normal" rows, but 25.933pt for the rows affected by the formatting. For some reason, BIP wants to generate a much taller row when it contains these formatted results.
I've experimented with attribute tags such as <?attribute@incontext:linefeed-treatment;'ignore'?> and <?attribute@incontext:height;14?>. I've used Word table formatting to fix the height of the row at exactly .3 inches. I removed the bold tag, and just kept the font color. None of those ideas was successful in removing the extra height.
Thoughts? -
[SOLVED] Where should I put this sound script?
I found a sound script so that when my tv outputs hdmi sound also does so automatically. Where do I put?
#!/bin/sh
if [[ $1 ]]
then
xrandr --output HDMI1 --off
pactl set-card-profile 0 output:analog-stereo
else
xrandr --output HDMI1 --mode 1920x1080 --right-of LVDS1
pactl set-card-profile 0 output:hdmi-stereo
Last edited by quasifilmie (2012-01-30 00:56:33)Yeah, I was afraid of that.
How do you start your window manager, and which window manager / desktop environment are you using?
If you are using startx, you could invoke it from your ~/.xinitrc. You might create a second scipt, launch it in the background, and put a sleep at the beginning to ensure X is ready.
KDE, Openbox and Xfce4 allow you to run scripts at start up. Gnome might, I would not know. -
Quick question, where to put global variables
Very quick question:
where is the best place to put global variables,
(e.g. a flag that turns on debug mode)
if they are needed by the entire application?
I'm guessing they should be placed in their own class.
But should I make them public static final constants,
and just do Globals.MYCONSTANT
OR should i do "implements Globals" in all my other classes?
The first way seems simpler and more logical,
but in the examples for JSDT, they use the second technique.
Any thoughts?
thanks! =)I would suggest either creating a properties file for your globals, or adding them to the system properties at startup. Placing items like debugging tags in your code means that you have to change the code, recompile, and rejar before your change is implemented. Using system properties means that you simply have to change your command-line options (i.e., from -Dmyapp.debug=true to -Dmyapp.debug=false).
Shaun -
Concat Variables from php script
Hi everyone !
Here is my problem,
My php script return me something like :
Town1='blabla'&Town2='bloublou' etc...
I'd like to add each town (loaded by LoadVars) in a ComboBox.
here is my script (in AS2) :
for (i=0; i<_root.tab_result.liste_lenght; i++) {
myCB.addItem(_root['tab_result.ville'+i],_root['tab_result.ville'+i]);
But i don't manage to concat the first part of the variable
name 'Town' and the value of i !
If somebody could help me ... :D thanks a lot.
Ps if it can help here is the result of
_root.tab_result.toString()...
ville30=%27VERNEUIL%2DSUR%2DSERRE%27&ville29=%27VAUCELLES%2DET%2DBEFFECO%27&ville28=%27URC EL%27&ville27=%27ROYAUCOURT%2DET%2DCHAILV%27&ville26=%27PARGNY%2DFILAIN%27&ville25=%27MONT BAVIN%27&ville24=%27MONS%2DEN%2DLAONNOIS%27&ville23=%27MONAMPTEUIL%27&ville22=%27MOLINCHAR T%27&ville21=%27MERLIEUX%2DET%2DFOUQUERO%27&ville20=%27LIERVAL%27&ville19=%27LAON%27&ville 18=%27LANISCOURT%27&ville17=%27FILAIN%27&ville16=%27ETOUVELLES%27&ville15=%27CLACY%2DET%2D THIERRET%27&ville14=%27CHIVY%2DLES%2DETOUVELLES%27&ville13=%27CHEVREGNY%27&ville12=%27CHER Y%2DLES%2DPOUILLY%27&ville11=%27CHERET%27&ville10=%27CHAVIGNON%27&ville9=%27CHAMBRY%27&vil le8=%27CHAILLEVOIS%27&ville7=%27BUCY%2DLES%2DCERNY%27&ville6=%27BRIE%27&ville5=%27BRAYE%2D EN%2DLAONNOIS%27&ville4=%27BOURGUIGNON%2DSOUS%2DMON%27&ville3=%27BARENTON%2DCEL%27&ville2= %27BARENTON%2DBUGNY%27&ville1=%27AULNOIS%2DSOUS%2DLAON%27&ville0=%27ARRANCY%27&liste%5Flen ght=31&envoi=precision&onLoad=%5Btype%20Function%5DDamn it i found :D
i had to write :
for (i=0; i<_root.tab_result.liste_lenght; i++) {
myCB.addItem(_root.tab_result['ville'+i],_root.tab_result['ville'+i]);
I just hope it could help someone else ahahha
Bye ;)
Séb. -
How do I enable Data Management if Passing an extra variable to PHP script?
Im trying to use dynamic SQL tables on my PHP server so I need to pass the table name to the PHP script. I don't understand why the Data Management system that sets up CRUD won't allow this extra parameter. It says it can only have one input: item. I can get all records, but when I try to create, update, or delete I get an error.
Or is there another way I can pass the tablename variable to the php file before I call any functions?
Thanks!I use it but does not work for me.
It does not integrates.
You can tag on url value pairs onto your php function call such as:
http://www.yourpath.php?tablename=tablenamesears
You can then extract tablename, by using get in your php script:
$tn = $_GET['tablename'];
This $tn can be used anywhere in your php script as a dynamic value for table targeting.
You can pass as many value pairs as you wish, every preceding pair must be in the form:
http://www.yourpath.php?tablename=tablename&action=update&author=admin
Hope it helps -
URLLoader with variables to php script
looking for an example of coding URLLoader / URLRequest with POST variables to a php script and back. Can this be adequately tested using WAMP locally?
var urlloader:URLLoader=new URLLoader();
var urlR:URLRequest=new URLRequest("yourphpscript.php");
var urlVar:URLVariables=new URLVariables();
urlVar.var1="whatever";
urlR.data=urlVar;
urlR.method = URLRequestMethod.POST;
urlloader.dataFormat = URLLoaderDataFormat.TEXT;
urlloader.addEventListener(Event.COMPLETE, completeF);
urlloader.load(urlR);
function completeF(e:Event):void {
trace(urlloader.data); -
Strange variables retrieved from php script
Hi,
I am experiencing a really strange thing when making my flash
movie communicate with a php script.
No matter what the animation is doing, just consider the
following :
see code below
ticket is the object which receives the response from server
which returns
echo utf8_encode("reponse=ok")
Each time when I run it , (ticket.retour.toString() != "ok")
returns true, and the redirection url shows the following :
http://xx.yy.zz.uu/jeu_avertissement.php?type=PROBLEME_CONNECTION&retour=ok&d=0.02&u=1&k=7 39f4db19af87cc0f2b72a6f63698500
showing value of my retour var which is equal to .... ok
I really don't understand! Could anybody explain me what
happened. It looks like I saw a UFO.
Thanks in advance,
PascalDamn it i found :D
i had to write :
for (i=0; i<_root.tab_result.liste_lenght; i++) {
myCB.addItem(_root.tab_result['ville'+i],_root.tab_result['ville'+i]);
I just hope it could help someone else ahahha
Bye ;)
Séb. -
Determine when a php script has run, then continue in actionscript
I want to run a php script before continuing to processs any more a.s. because the php script creates an xml file on which the a.s. depends. In addition, I need to send a variable to the php script that tells it what kind of xml script it will create.
(i suppose I could just add the rest of the a.s. into a later frame but that sounds like a method when all else fails)
Here's how it works in detail:
1. someone clicks on the "oil" button which means they want to view all the images in the "oil" gallery.
2. A php script creates an xml that includes only the oil images (that''s the variable it must receive from Flash "oil").
3. The php script finishes its job before a.s. script continues
Here's how I started but I'm not even sure what type of "event" is used to listen for a finished php script or where to put the variable parameter:
oil_btn.addEventListener(MouseEvent.CLICK,xmlGenesis);
function xmlGenesis
(evt:MouseEvent):void{
var urlRequest:URLRequest= new URLRequest
('xmlGenesis.php');
navigateToURL (urlRequest);
thank you for your assistance
chopWell, after a few hours of looking around the Internet and in reference books and at the example you indicated, I finally managed to nail the pieces together to get something that works... just before I decided to start drinking again. whew! It works!
var myVariables:URLVariables = new URLVariables();
myVariables.gallery = "nature";
var myURLRequest:URLRequest = new URLRequest("xmlGenesis.php");
myURLRequest.data = myVariables;
var ulLoader:URLLoader= new URLLoader();
ulLoader.addEventListener(Event.COMPLETE,xmlComplete);
ulLoader.load(myURLRequest);
function xmlComplete (ev:Event):void{ // finished creating xml file
do everything else
thank you
That which doesn't kill us makes us stronger.
Friedrich Nietzsche
Maybe you are looking for
-
SET NULL not working in SQL*Plus
DB Version: 10.2.0.4 Question1. Won't SET NULL work with PL/SQL block? Question2. Why is <<>> appearing in several lines (one character per line) as shown below? Sorry about the "jive-quote" thing below, got that after i added code tags. SQL > show l
-
What's with the obsession for the new MB Core 2 Duo?
I just don't understand why many MB users are crying about the Macbook C2D which just came out today. I don't see much of improvement of this generation compared to the 1st one. Seems to me the only major change is just the CPU, which generally gives
-
Add a custom tab to include custom fields in Shipment Screen (VT03N)
Hello every one, We have a requirement to add a custom tab to include custom fields in shipment header. Can any one of you help me on this? Thanks in advance !!! Regards, Ganga
-
Dynpro table - footer and highlight selected row
I have two questions reg. tables: WebAS 6.40 SP13 a) Although I set the property footerVisible to false, I do still have this navigation footer visible. Is there another condition which must be met in order to hide it (e.g. design alternating works o
-
The disk cannot be partitioned because some files cannot be moved.
everytime i try to partition my hard drive i get this error message. im not exactly sure if it means to burn it to a disk or back it up on a separate hardrive. any help with this matter would be GREATLY appreciated Back up the disk and use Disk Utili