Jump to content

jjmusicpro

Members
  • Posts

    290
  • Joined

  • Last visited

    Never

Everything posted by jjmusicpro

  1. how do i do it with javascript, not on a post back?
  2. i have a simple form, and wanted to check if a check box is checked, if not, then dont go to next page, but if it is, then its ok. right now i have code to check text box values and see if they are filled in, but dont know how to check, to see if a check box is filled.
  3. Yeah, i just want to be able to pass the value of the hyperlink to my ajax script
  4. i tried this <a href="" onClick="showHint(this.value)" title="Value 1">Value 1</a> but it didnt work this works, if i put it in a drop down box.. <option value="Value 1">Value 1</option>
  5. how can i add a value to a hyperlink? i am running ajax, and wanted to pass the value of the hyperlink to ajax... this is what i have now... <a href="" onClick="showHint(this.value)">Click 1</a>[code] [/code]
  6. yeah not text areas, these will be text box's. by default i want the text box to say "worker" but also give them an option to type in whatever over that.. but i dont want it to pass the default text "worker" if its been typed over. I think if i used "value=worker" for a text box, regardless of what they put in, it will always be worker.
  7. setting default value for a from text box so i created a form with username firstname lastname and description. I wanted the description field to be filled with a default value of "worker", but if they type over that, i wanted it to enter that value into db. i just didnt know if the value="worker" will almost make the desciprtion box worker.
  8. I cant figure out how to make this echo out records until no records are found. $db = mysql_connect("localhost", "pump_user","xxx") or die("Could not connect."); // Connection to DB if(!$db) die("no db"); if(!mysql_select_db("pump_db",$db)) die("No database selected."); $acc1="select * from teams"; $i = 0; $acc2=mysql_query($acc1) or die("Could not enter details"); // Error if nothing is selected while($acc3=mysql_fetch_assoc($acc2)) i++; $teamname = $acc3[Team_Name]; $teamcaptain = $acc3[Captain_Name]; echo " $i $teamname $teamcaptain ";
  9. so i posted the data, and it was entered into the db fine, however, i wanted to do a redirect after the info is enter to another page, how do i do that? this is all thats in my page i posted to <?php $teamname = $_POST['team_name']; $teamcaptain = $_POST['team_captain']; $teamphone = $_POST['phone_number']; $teamemail = $_POST['email_address']; $db = mysql_connect("localhost", "pump_user","xxxxxx") or die("Could not connect."); // Connection to DB if(!$db) die("no db"); if(!mysql_select_db("pump_db",$db)) die("No database selected."); $acc1="insert into teams (Team_Name,Captain_Name,Team_Email,Team_Phone,Team_Entered) values ('$teamname','$teamcaptain','$teamphone','$teamemail',now())"; $acc2=mysql_query($acc1) or die("Could not enter details."); // Error if nothing is selected ?>
  10. so I am having them post the information to another page that takes those values and adds them to my DB, how do i do a redirect after its entered?
  11. i am trying to post the variables that were put into a form, to post to another page, but cant get it to work. ALso, i dont know how to take those posted variables, and enter them into the db. <form id=\"form1\" name=\"form1\" method=\"post\" action=\"2008pumpplayeradd.php\"> If you dont have a team, but want to play, sign up here!<br /> Player Name: <label> <input type=\"text\" name=\"player_name\" /> </label> <br /> Phone Number: <label> <input type=\"text\" name=\"phone_number\" /> </label> <br /> Player Email. <label> <input type=\"text\" name=\"player_email\" /> </label> <br /> <label> <input type=\"submit\" name=\"Submit\" value=\"Submit\" /> </label> </form> here is whats on my form i am posting to $db = mysql_connect("localhost", "pump_user","xxxx") or die("Could not connect."); // Connection to DB $teamname = GET_("team_name"); $teamcaptain = GET_("team_captain"); $teamphone = GET_("team_number"); $teamemail = GET_("team_address"); if(!$db) die("no db"); if(!mysql_select_db("2008pump",$db)) die("No database selected."); $acc1="insert into id (teamname,teamcaptain,teamphone,teamemail) values ($teamname,$teamcaptain,$teamphone,$teamnail,now())"; $acc2=mysql_query($acc1) or die("Could not select accounts."); // Error if nothing is selected after that is done, i wanted to post them back to another page, but dont knwo how to do that.
  12. I wnated to add this but dont know where <?php $db = mysql_connect("localhost", "pump_user","xxxx") or die("Could not connect."); // Connection to DB if(!$db) die("no db"); if(!mysql_select_db("2008pump",$db)) die("No database selected."); $acc1="SELECT * from ID"; $acc2=mysql_query($acc1) or die("Could not select accounts."); // Error if nothing is selected $i = 1; while($acc3=mysql_fetch_assoc($acc2)) $teamname = $acc3[Team_Name]; $Captain_Name = $acc3[Captain_Name]; i++; echo =" $i . '$teamname' . ' ' . '$Captain_Name'"; ?>
  13. hey everyone im new at this... thanks again for the help i wanted to connect to my msql database and get team name, and team captain, and have it display it out, in an echo statment, however, im not sure how to do this, since i alreayd have an echo stament displaying the table. thanks again for the help. this is what i have so far. function DisplayInfo(){ global $sitename, $module_name; include_once("header.php"); include_once("conn.php"); include_once("open.php"); title("$sitename "._STATS.""); opentable(); echo "<br />"; echo "<center>"; echo "<table width=\"46%\" border=\"0\"> <tr> <td width=\"45%\" valign=\"top\"><strong>Teams Signed up</strong><P> <p> <form id=\"form1\" name=\"form1\" method=\"post\" action=\"\"> Sign up your team!<br /> Team Name: <label> <input type=\"text\" name=\"team_name\" /> </label> <br /> Team Captain: <label> <input type=\"text\" name=\"team_captain\" /> </label> <br /> Phone Number: <label> <input type=\"text\" name=\"phone_number\" /> </label> <br /> Email: <label> <input type=\"text\" name=\"email_address\" /> </label> <br /> <label> <input type=\"submit\" name=\"Submit\" value=\"Submit\" /> </label> </form> </strong></td> <td colspan=\"2\" rowspan=\"2\"> </td> <td width=\"51%\"><strong>Players (With no Teams) <br /> </strong>If you want to joing the fun, sign up here.<p> <form id=\"form1\" name=\"form1\" method=\"post\" action=\"\"> If you dont have a team, but want to play, sign up here!<br /> Player Name: <label> <input type=\"text\" name=\"player_name\" /> </label> <br /> Phone Number: <label> <input type=\"text\" name=\"phone_number\" /> </label> <br /> Player Email. <label> <input type=\"text\" name=\"player_email\" /> </label> <br /> <label> <input type=\"submit\" name=\"Submit\" value=\"Submit\" /> </label> </form>
  14. Ok, i can send inputs to a COM object, and have it work, however, i dont know how to handle the output of a COM object, i dont know how to capute the data it returns, here is an example. XGET.GetPortNumber long GetHostPortNumber([out] long * PortNumber) Here is what I have so far, where it can send data into the program, however, i wanted to run a test where i can get data back from a com object. <?php $My_Object = new COM($Your_DLL_Path) or die("Cannot start"); $retval2 = $My_Object->Connect($Your_Server,$Your_Port); $retval2 = $My_Object->SetVariableText("%Customer_First_Name%", "sdfsdf"); $retval2 = $My_Object->SetVariableText("%Customer_Last_Name%", "adfadf"); $retval2 = $My_Object->SetVariableText("%Customer_Description%", "Padf Description"); $retval2 = $My_Object->ExecuteProjectScript("COM_Add_User"); echo "User Created"; ?>
  15. i can get this to work below, however, i dont know how to make another instance of a different method in the dll. so i can get AcomLib.dll has... .grra .mywebform .mywebtable i can use the dll and use grra and use the procedures i do, and it works fine. however, i dont know how to use the ohter methods like .mywebform <?php $My_Object = new COM($Your_DLL_Path) or die("Cannot start"); $retval2 = $My_Object->Connect($Your_Server,$Your_Port); $retval2 = $My_Object->SetVariableText("%Customer_First_Name%", "sdfsdf"); $retval2 = $My_Object->SetVariableText("%Customer_Last_Name%", "adfadf"); $retval2 = $My_Object->SetVariableText("%Customer_Description%", "Padf Description"); $retval2 = $My_Object->ExecuteProjectScript("COM_Add_User"); echo "User Created"; ?>
  16. ok so now im confused, i called the dll, and i cant figure out how to create a new instance of it, and run a method. here is what i have in asp.net c#, it works UMRAcomLib.Umra _UMRA = new UMRAcomLib.Umra(); _UMRA.SetVariableText("%Customer_First_Name%", firstname); _UMRA.SetVariableText("%Customer_Last_Name%", lastname); _UMRA.SetVariableText("%Customer_Description%", description); _UMRA.ExecuteProjectScript("COM_Add_User"); but how do i do that in php ? here is what i have so far. <?php // UMRA Variables $Your_UMRA_Server = "xxxxx"; // UMRA Server Name $Your_UMRA_Port = "xxxx"; // Default is 56814 $Your_UMRA_DLL_Path = "dll/xxxxxx" //Path to your UMRA DLL $Connection_Status = ""; // Connection to UMRA Status ?> <?php $UMRA_Object =new COM("$Your_UMRA_DLL_Path") or die("Cannot start word for you"); print "Loaded word version ($UMRA_Object->Version)\n"; $UMRA_Object->Umra->Connect("$Your_UMRA_Server",Your_UMRA_Port); if($UMRA_Object->Umra->Connect != 0) { $Connection_Status = "Not Connected"; } else { $Connection_Status = "Connected"; } ?>
  17. Does the DLL have to be in the same folder as the index.php file?
  18. How to use a dll. COM object in php? I dont know the correct syntax... Never used one before.. so if the dll was somedll.dll and how do i create a new instance of that dll? thanks again everyone.
  19. Ok, i tried to get this to work but couldnt figure it out, right now, its ment for a center block, but i wanted to make it a right block, and just have it display the pictures down, and not accross, i tried to put a break link after each but didnt work here is the code thanks again guys! $content .= '<br /><table width="200" cols="1" border="0" cellpadding="0" cellspacing="0" border="1" align="center"><tr align="center">'; $pic = 0; while ($row = $db->sql_fetchrow($result)) { if (defined('THEME_HAS_RATING_GRAPHICS')) { $theme_prefix = $CONFIG['theme'].'/'; } else { $theme_prefix = ''; } $caption = '<img src="' . $CPG_M_DIR . '/' . $theme_prefix . 'images/rating' . round($row["pic_rating"] / 2000) . '.gif" align="center" border="1">' . '<br />' . sprintf($lang_get_pic_data['n_votes'], $row['votes']) . '<br />'; if ($CONFIG['seo_alts'] == 0) { $thumb_title = $row['filename']; } else { if ($row['title'] != '') { $thumb_title = $row['title']; } else { $thumb_title = substr($row['filename'], 0, -4); } } stripslashes($thumb_title); $content .= '<td align="center" valign="baseline"><a href="' . $CPG_M_URL . '&file=displayimage&meta=topn&cat=0&pos=' . $pic . '"><img src="' . get_pic_url($row, 'thumb') . '" border="0" alt="' . $thumb_title . '" title="' . $thumb_title . '"><br />' . $caption . '</a></td>'; $pic++; } $content .= '</tr><tr><td colspan="'.$limit.'" valign="baseline" align="center"><a href = "'. $CPG_M_URL . '">'.$lang_pagetitle_php["photogallery"].'</a></td></tr></table>';
  20. I made a database that holds the values for the markers on a google map, i am able to pull the where to center map, but i cant pull the values into the javascript. everyting works except this any ideas? this is whats in my header: $mapcontent = $row['maplocations']; here is info for map map.setCenter(new GLatLng(<?php echo $mapcenter; ?>),9); <?php echo $mapcontent; ?> } else { alert("Sorry, the Google Maps API is not compatible with this browser"); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.