Jump to content

respecttheplayer

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

respecttheplayer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I figured maybe seeing this in action is easier sometimes than trying to find out what is wrong. http://thegreatestsave.org/add/dd.php Thanks
  2. echo "<form method=get name=f1 action='dd-check.php'>"; ////////// Starting of first drop downlist ///////// echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Select one</option>"; while($noticia2 = mysql_fetch_array($quer2)) { if($noticia2['category']==@$cat){echo "<option selected value='$noticia2[category]'>$noticia2[category]</option>"."<BR>";} else{echo "<option value='$noticia2[category]'>$noticia2[category]</option>";} } echo "</select>"; If i choose to switch the first drop down, i can get it to show the state abbreviations but then the city field never populates so it's pretty much in reverse and getting worse, still trying and was just giving anyone more information in case they were curious if i tried something or not.
  3. I am trying to accomplish a custom State / City drop down using a database and I am running into a small problem of pulling the wrong variable (field from the database). My end result is this State is 4 City is Jonesboro As you can see there are no states called "4", that is the cat_id assigned to the state which would be Arkansas. I have gotten to the point where I need an extra eye to point out what I am doing wrong because I am doing more harm than good right now deleting/adding code just to see if it works.... <?php @$cat=$HTTP_GET_VARS['cat']; // Use this line or above line if register_global is off ///////// Getting the data from Mysql table for first list box////////// $quer2=mysql_query("SELECT DISTINCT category,cat_id FROM category order by category"); ///////////// End of query for first list box//////////// /////// for second drop down list we will check if category is selected else we will display all the subcategory///// if(isset($cat) and strlen($cat) > 0){ $quer=mysql_query("SELECT DISTINCT subcategory FROM subcategory where cat_id=$cat order by subcategory"); }else{$quer=mysql_query("SELECT DISTINCT subcategory FROM subcategory order by subcategory"); } ////////// end of query for second subcategory drop down list box /////////////////////////// echo "<form method=post name=f1 action='dd-check.php'>"; ////////// Starting of first drop downlist ///////// echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Select one</option>"; while($noticia2 = mysql_fetch_array($quer2)) { if($noticia2['cat_id']==@$cat){echo "<option selected value='$noticia2[cat_id]'>$noticia2[category]</option>"."<BR>";} else{echo "<option value='$noticia2[cat_id]'>$noticia2[category]</option>";} } echo "</select>"; ////////////////// This will end the first drop down list /////////// ////////// Starting of second drop downlist ///////// echo "<select name='subcat'><option value=''>Select one</option>"; while($noticia = mysql_fetch_array($quer)) { echo "<option value='$noticia[subcategory]'>$noticia[subcategory]</option>"; } echo "</select>"; ////////////////// This will end the second drop down list /////////// //// Add your other form fields as needed here///// echo "<input type=submit value=Submit>"; echo "</form>"; ?> the second page "dd-check.php" is simple <?php $cat=$_POST['cat']; $subcat=$_POST['subcat']; echo "State is $cat <br>City is $subcat "; ?> The $cat has a result of 4 or I should say a NUMERIC value of the state and need to be able to find a way to pull the result of the state instead..... Additional Info (database architecture if this helps) CREATE TABLE `category` ( `cat_id` int(2) NOT NULL auto_increment, `category` varchar(90) NOT NULL, PRIMARY KEY (`cat_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=52 ; INSERT INTO `category` VALUES(1, 'AL'); INSERT INTO `category` VALUES(2, 'AK'); INSERT INTO `category` VALUES(3, 'AZ'); INSERT INTO `category` VALUES(4, 'AR'); CREATE TABLE `subcategory` ( `cat_id` int(2) NOT NULL default '0', `subcategory` varchar(90) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `subcategory` VALUES(4, 'Ft. Smith-Fayetteville-Springdale-Rogers'); INSERT INTO `subcategory` VALUES(4, 'Jonesboro'); INSERT INTO `subcategory` VALUES(4, 'Little Rock-Pine Bluff'); INSERT INTO `subcategory` VALUES(4, 'Springfield');
  4. Thanks vine, that was exactly it, I honestly do not know why they were there, I guess that's what I get when I am being lazy and do not really think things through, I got it working now. Thanks abazoskib for your answer as well in the reason why each example would not work. Thanks again guys.
  5. Right now i have a email form that I want to email to certain people depending on their answer, such as if productinfo = chucks then email to bob and jerry, but if productinfo = rotarytables then email to bob and tim but not jerry...... I hope you could follow that anyways my code is below for the email.php which processes the form. I have tried two ways doing this to show that I am trying, so maybe you can take a look at both and tell me where I am going wrong? One more thing from what I am noticing is that it's sticking on the first conditional statement and never acts to check if there are more conditions to be met so I know my code sucks now . PHP email.php version 1 <?php if($productinfo = 'rotarytables') { $to = ' x@gmail.com, x@yahoo.com'; $subject = "x.Net Contact Us from $fullname"; $message = "<p>stuff here</p>"; // must be double quoted to be able to use variables inside a string $headers = "From: randybennett23@gmail.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; } elseif($productinfo = 'chucks') { $to = ' x@gmail.com, x@kindervision.org'; $subject = "x.Net Contact Us from $fullname"; $message = "<p>Stuff here</p>"; // must be double quoted to be able to use variables inside a string $headers = "From: x@gmail.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; } else { // Send $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "<center><p><span class=\"bold\">Thank you $fullname! Your mail was sent successfully, the details are as followed</span></p></center>"; } else {print "<p><span class=\"bold\">We encountered an error sending your mail, please go back to the <a href=\"contact.php\">contact form</a></span></p>"; } } ?> email.php version 2 <?php if($productinfo = 'rotarytables') { $to = ' x@gmail.com, x@yahoo.com'; $subject = "x.Net Contact Us from $fullname"; $message = "<p>Stuff here</p>"; // must be double quoted to be able to use variables inside a string $headers = "From: x@gmail.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; // Send $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "<center><p><span class=\"bold\">Thank you $fullname! Your mail was sent successfully, the details are as followed</span></p></center>"; } else {print "<p><span class=\"bold\">We encountered an error sending your mail, please go back to the <a href=\"contact.php\">contact form</a></span></p>"; } } elseif($productinfo = 'chucks') { $to = ' x@gmail.com, x@kindervision.org'; $subject = "x.Net Contact Us from $fullname"; $message = "<p>Stuff Here</p>"; // must be double quoted to be able to use variables inside a string $headers = "From: x@gmail.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; // Send $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "<center><p><span class=\"bold\">Thank you $fullname! Your mail was sent successfully, the details are as followed</span></p></center>"; } else {print "<p><span class=\"bold\">We encountered an error sending your mail, please go back to the <a href=\"contact.php\">contact form</a></span></p>"; } } ?> Let me know if I am not clear in my question and I 'll try my best to give you the information you may need, other than that, thanks a ton for taking a look at my code to teach me what I am doing wrong.
  6. quick reply...the one matthewJ did worked for me in case this forum gets searched in the future!
  7. awesome, thank you both for your quick replies, both look like they will work for what I was looking to do!!!! I appreciate the help! I just was not sure if I was able to put conditional statements in between the $query, $result in fear that it might break the code and this will help me in lots of future coding!
  8. My problem may be easier than what I am making it out to be but maybe you can tell me what I need to do or what I need to research to get this issue fixed. Basically I want to have a page that pulls a query from the database and if it does not exist to redirect to another page. My SQL is working flawlessly and is pulling the results but if a query does not exist there is private information that is still shown so I want it to be redirected rather than them staying on that page. My code is below <?php //Setup connection to the database $connect = mysql_pconnect("localhost", "user", "password") or die(mysql_error()); //Connect to the database mysql_select_db("userdatabase", $connect) or die(mysql_error()); $query = "SELECT * from Employees WHERE email='$email' AND kv_code='$password'"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<b>Full Name:</b> {$row['full_name']}<br> <b>Phone Number:</b> Main: {$row['phone_number']}"; } ?> I am then thinking that if the query does not exist or at least the query does not include any information to then redirect it using header('Location: http://www.domain.com'); But where do I put the header redirect into the above where it is pulling the mysql result?
  9. I guess I am not in any huge rush but was wondering if anyone had some time to install themselves and see if they get it to work with the ghostscript and imagemagick? If so let me know and I would like to find out where you got the executable file and if you just put the executable file in the root folder of RELAY or you had to do something else. Very curious to see it 100% working. Thanks Corbin for the info, I was on track about the path in which it needs but was not too sure if i just sit a .exe in the folder and it will do its thing on its own...having trouble even finding the right exe for the job as well, just thought i would show this to the community as I thought this script was extremely useful!
  10. http://www.ecosmear.com/relay/ This is the file management system I chose to go with. I am not sure how popular this is in the AJAX community but wanted to see if anyone was able to help me out with my issue. I have successfully installed it on my server and got it to upload, etc...but this application (AJAX) has a few features that you supposably can install if you choose to in the beginning phases of a walk through installation. They are 2 Utilities "ImageMagick's convert.exe and Ghostscripts gswin32c.exe. I have included a picture of this. It asks for a path and I am not sure what I need to do to get these two things to work. I read the wiki and there is no info on this, I just continued installation with out them and it tells me I did not install them as well. Basically these two things are good for previewing a lot of different extensions beyond your .jpg Any information you may have to help me out in resolving this would be great. I definitely recommend the ajax application with or without the preview but it is definitely something I would love to have!
  11. Thanks sKunKbad, i called up my hosting company and had them access my php.ini file, for whatever reason owning a dedicated server i still did not have root access!!! But anyways after running a php info script and seeing that it was turned off i had them change it. Just to let everyone know in case this is referenced and helps someone, it was actually left off of the .ini file all together, for whatever reason they thought it was such a security risk that they deleted the line all together. I had them insert it back in and everything worked!!! If anyone knows better practice for coding headers in subfolders than what i am doing i am all ears, but for now i got this figured out and hopefully some one will benefit from this. Thanks so much.
  12. Can i show my PHP Info, i just uploaded a file to my server, but I do not want to show everyone if it will make it a security risk? Also what do i look for in my .ini if you don't mind me asking. By the way just 1 hour ago my dedicated server was updated from PHP 4 to PHP 5 just a fyi.
  13. I am trying to better understand why (DOES NOT WORK) else { ob_start(); include("http://www.thegreatestsave.org/header.php"); } ?> But when i remove the absolute path it does work else { ob_start(); include("header.php"); } ?> Of course this is not practical if i want to use it for files in subfolders that are looking for header.php and it is not practical to upload header.php in every subfolder? This is just a snippet of code but I am sure there is no need for more. I look forwarded to learning more about php5 since I just made the jump!
  14. I will keep this open in case someone figures something out later, but I did the tedious work and just added %20 into all the space in the database field "mapquest" I know that it can work with out it, i just need to figure it out or be directed correctly. Thanks again for input
×
×
  • 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.