Jump to content

Search the Community

Showing results for tags 'data'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. So I hate to bother everyone with what seems to be such a small question, but I assure you I DID search through the forums here looking for an answer... maybe I didn't search hard enough but the book I'm learning from couldn't help me with this problem either. The code I'm working on is a basic mailing list application, made up of three PHP/HTML pages. One for adding emails to the MySQL database table, one to remove, and one to send an email to all the emails in the list. Currently, I'm trying to learn how to make the Subject and Body fields 'sticky' in case the user makes an error and leaves a field blank in the send_email.php. I've tested it a bunch of times and tried to tweak it but the Body field won't stick! I can leave the body empty and add a subject, and the error comes up properly and the subject stays in the subject line, but if I do it the other way the body won't stick. I don't get it because the code is the same for both of them, at least as far as I can tell... Here's a paste of send_email.php. (I blanked out my email and the database password for privacy reasons). They're also teaching us to put everything in one page, instead of having two separate HTML and PHP pages. So I just migrated everything from the HTML page into the PHP page -- and it didn't affect this problem either way. So I think I did that part right. Any and all help is MUCH appreciated!! (PS also -- I do my coding on Linux (specifically Ubuntu and/or Fedora, and I would LOVE to have some sort of debugger for PHP... currently I'm using gedit with a bunch of extra plugins to support PHP coding (auto-completes, highlighting, etc) but I also have Eclipse, which I used to use for Java/Android SDK development. I know it has PHP support but it doesn't seem to work for me... does anyone have any tips? If I could get a debugger working I'm sure that would help solve a LOT of these problems!) (PPS -- the website is currently live at http://aureliusr.mine.nu/ if you want to check it out)
  2. Hey, Im new to PHP and am trying to make a simple form where it puts the form data into a table called "users" This is the form: <p><form method="post" action="register.php"> <table border="0" align="center"> <tr> <td>Username</td><td><input type="text" name="username" size="15" > </tr> <br /> <tr> <td>Password</td><td><input name="password" type="password" size="15"></td> </tr> <br /> <td><input type="submit" value="Sign Up"/></td><td></td> </table> This is the php code: <?php $dbhost = ''; $dbname = ''; $dbuser = ''; $dbpass = ''; mysql_connect($dbhost,$dbuser,$dbpass); mysql_select_db($dbname); $order = "INSERT INTO users (username, password) VALUES ('$username', '$password')"; $result = mysql_query($order); if($result){ echo("<br>It Worked!"); } else{ echo("<br>It Failed!"); } ?> But when i upload it to the server and try it, it says there was a entry but its blank..... When i upload it to a server and try it, it automaticly seems to post the data to the database before i even enter a username/password! when i type a username/password in and post it again it says there was another entry but its blank..... any help? - Thanks!
  3. I'm attempting to set display some data pulled from the database and present it in a table so i can get everything to line up correctly. When I attempt to form a table around it, the content hops out of the table or part of it does not display. Working on the first row, it currently displays 'CITIZENSHIP: USA' //if ($citizenship) { echo "<strong>CITIZENSHIP:</strong> $citizenship"; If I try this, it displays 'USA', the citizenship 'vanishes'. //if ($citizenship) { echo "<tr> // <td align=\"right\" valign=\"top\"><p><strong>CITIZENSHIP:</strong></p></td> // <td width=\"10\"> </td> // <td valign=\"top\"><p>" . $citizenship . "</p> // </td></tr>"; <table cellpadding=\"0\" cellspacing=\"0\"> <?php //if ($citizenship) { echo "<tr> // <td align=\"right\" valign=\"top\"><p><strong>CITIZENSHIP:</strong></p></td> // <td width=\"10\"> </td> // <td valign=\"top\"><p>" . $citizenship . "</p> // </td></tr>"; if ($citizenship) { echo "<strong>CITIZENSHIP:</strong> $citizenship"; if ($legalstatus) { echo ", $legalstatus"; } echo "<br >\n"; } else if ($legalstatus) { echo "<strong>Legal Status:</strong> $legalstatus"; } // end legal status if ($type=="administrator" || $type=="alumni" || $type=="faculty" || $type=="staff" || $type=="student") { $theseFields = array("placeofbirth", "maritalstatus", "occupation", "affiliation"); } else { $theseFields = array("placeofbirth", "maritalstatus", "occupation", "affiliation", "baseofoperations"); } // end if resident foreach ($theseFields as $thisField) { if (${$thisField}) { echo "<strong>" . ${$thisField . "Name"} . ":</strong> "; echo ${$thisField}; if (isset(${"former" . $thisField})) { if (${"former" . $thisField}) { echo " (formerly " . ${"former" . $thisField} . ")"; } } // end if set } // end if info } // end FOREACH if ($type=="administrator" || $type=="alumni" || $type=="faculty" || $type=="staff" || $type=="student") { ?> </table> ANy help would be greatly appreciated. I'm very much a newb. Thanks to anyone kind enough to try to help me with this. I've been struggling with this all day and i really thought it'd tage a few minutes. Thanks
  4. Sorry I think my topic question is weird but just want to make the wordings as less as possible. I read a few of the threads but none of them seem to match what I need. What I'm trying to do it something like a voting system but does not include mysql at the moment. I made three radio buttons of music types pop, rock, metallic and a submit so whichever a person choose either one of them and submit the data is wrote into a data.json and stored there. Then I have a page to load all the data in data.json file but I want to count how many people selected for example metallic and how many people selected rock. at the moment I'm still testing and I actually thought of an idea but somehow searched up and not getting what I want.....can someone give me a hand? this is my data.json file {"type":"metallic"} {"type":"pop"} {"type":"metallic"} and this is what my result code is at the moment <?php $file = fopen('data.json', "r"); $array_record = array(); while(!feof($file)) { $line = fgets($file); $data = json_decode($line, TRUE); if (is_array($data)) { foreach ($data as $key => $value) { // echo $key.'='.$value.' '; // show key=value pairs $array_record += array($value,); var_dump($data); print_r($data); echo $value; } echo '<br>'.PHP_EOL; } } fclose($file); ?> I know the codes are messy because I tried setting up an empty array first then get the $value which is something like metallic into an array so I can use the array_count_values but the way I'm doing it seems totally wrong or that'd never work. I tried few other ways to get only metallic/pop so I can try counting the same thing. Thanks in advance.
×
×
  • 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.