Jump to content

webdevdea

Members
  • Posts

    144
  • Joined

  • Last visited

About webdevdea

  • Birthday 01/28/1969

Profile Information

  • Gender
    Female
  • Location
    Atlanta
  • Interests
    Php, Sql, Ruby, Rails, Python, Django, Backbone.js
  • Age
    45

webdevdea's Achievements

Member

Member (2/5)

0

Reputation

  1. webdevdea

    Json help

    how would i change data type from html to json,
  2. webdevdea

    Json help

    yes I think it is not formatting correctly..
  3. webdevdea

    Json help

    at my link http://dandewebwonders.com/BBProject%204/index.php when you click on players you see the error.. this is what i need to do .. change data type from html to json, fix the controller error, and change it to parse the data.data object. case "listPlayers_Data" : $response = null; $results = array(); $players = new PlayersClass(); foreach ($players -> RetrieveAll() as $row) { $results[] = new PlayerListModel($row -> Id); } $response -> data = $results; echo json_encode($response); break; and a link to the project on github https://github.com/deannariddlespur/bb_Project/blob/master/Controllers/Controller.php
  4. public function saveCreate() { $input = Input::all(); try { $clientsite = new ClientSite; $clientsite->siteName = $input['siteName']; $clientsite->description = $input['description']; $clientsite->launchDate = $input['launchDate']; $clientsite->save(); //ClientSite::whereSiteName($clientsite->siteName)->first(); ClientSite::where('siteName', $clientsite->siteName)->first(); $clientID = $clientsite['clientID'];//getting clientID for use in join query //queries for retrieving features of each group for the selected client $clientFeatures = DB::table('features')->join('clientFeatures', function($join) use($clientID) { $join->on( 'clientFeatures.featureID', '=', 'features.featureID') ->where('clientFeatures.clientID', '=', $clientID); })->get(); $groupIDs = array(); foreach ($clientFeatures as $c) $groupIDs[] = $c->groupID; } catch(\Illuminate\Database\QueryException $e) { return View::make('profiles.clientProfiles')->with('clientsite',$clientsite) ->with('groupIDs',$groupIDs) ->with('clientFeatures',$clientFeatures) ->with('status','<strong>'.$siteName.' Site already exist!</strong>'); ; } } public function show($clientID) { $clientsite = Clientsite::find($clientID); return View::make('clientsite', compact('clientsite')); }
  5. I am new to the Laravel Framework, doing an internship and at the very end.. I need some assistance please with some try catch error, Its supposed to throw an error if the site name is already in the database.. If someone could help me please and thank you .. ``` public function create() { return View::make('edit.create'); } public function edit( $clientsite ) { return View::make('edit.edit', compact('clientsite')); } public function saveCreate() { $input = Input::all(); try { $clientsite = new ClientSite; $clientsite->siteName = $input['siteName']; $clientsite->description = $input['description']; $clientsite->launchDate = $input['launchDate']; $clientsite->save(); //ClientSite::whereSiteName($clientsite->siteName)->first(); ClientSite::where('siteName', $clientsite->siteName)->first(); $clientID = $clientsite['clientID'];//getting clientID for use in join query //queries for retrieving features of each group for the selected client $clientFeatures = DB::table('features')->join('clientFeatures', function($join) use($clientID) { $join->on( 'clientFeatures.featureID', '=', 'features.featureID') ->where('clientFeatures.clientID', '=', $clientID); })->get(); $groupIDs = array(); foreach ($clientFeatures as $c) { $groupIDs[] = $c->groupID; } catch(\Illuminate\Database\QueryException $e) { return View::make('profiles.clientProfiles')->with('clientsite',$clientsite) ->with('groupIDs',$groupIDs) ->with('clientFeatures',$clientFeatures) ->with('status','<strong>'.$siteName.' Site already exist!</strong>'); ; } ``` https://github.com/webdevdea/MyDyn ( i have not pushed these changes because I have an error )
  6. Thank you so much, I am very new to this and learning. I had thought I asked the question right but I guess I didnt.. Im trying to learn and sometimes being a female I get treated like I am stupid.. Im going to try the above sample and see
  7. I have created a sample database for a race. I want to make it so you do not have to update all of the information when update is selected. Link to the project and here is the update.php file How do i get the fields to retain the information that was already entered so that user does not have to put data in every field upon update.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta name="author" content="" /> <link rel="stylesheet" type="text/css" href="style.css" media="screen" /> <title>Angels 5K & 1 Mile Family Fun Run/Walk </title> <?php include('header.php'); ?> <?php include('nav.php'); ?> <?php include 'connection.php';?> </head> <body> <div id="wrapper"> <fieldset> <form method="post" action=""> <select name="select" id="del"> <option id="0"> --Select your Name--- </option> <?php $aaa=mysql_query("select * from DR_race"); while ($view = mysql_fetch_array($aaa)) { ?> <option id=" <?php echo $view['ID'];?> "> <?php echo $view['LastName'];?> </option> <?php } ?> </select> </fieldset> <br> <br> <br> <?php //<input type="submit" /> save it to later use $D= filter_input(INPUT_POST, "select"); include 'connection.php'; $con=mysqli_connect($dbhost,$dbuser,$dbpassword,$dbdatabase); if (isset($_POST['firstname'])&& isset($_POST['lastname']) && isset($_POST['phone']) && isset($_POST['email']) && isset($_POST['age']) && isset($_POST['size'])) { $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $Phone = $_POST['phone']; $email = $_POST['email']; $age = $_POST['age']; $size= $_POST['size']; } else { $firstname = "(Not entered)"; $lastname = "(Not entered)"; $Phone = "(Not entered)"; $email = "(Not entered)"; $age = "(Not entered)"; $size = "(Not entered)"; } echo <<<_END <body> <form method="post" action=""> <fieldset> Firstname: <input type="text" name="firstname" required/><br><br> LastName : <input type="text" name="lastname" required/><br><br> Phone: <input type="text" name="phone" required /><br><br> E_mail: <input type="text" name="email" required /><br><br> Age: <input type="text" name="age"/ required ><br><br><br> T-shirt size: <input type="text" name="size" required /> <input type="submit" value="update" /> </form> </fieldset> </body> </html> _END; // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } mysqli_query($con,"UPDATE DR_race SET FirstName='$firstname' , LastName='$lastname' , Phone='$Phone', Email='$email' , Age='$age' , Size='$size' WHERE FirstName='$D' "); //******************************************** ?> </form> <<?php include('footer.php'); ?> </body> </html>
  8. I have the game working but when it pulls up it automatically says the guess is to low try again What do I need to do for the game to pull up and start from scratch without assuming the user has already entered input? Here is the working link to see what I am talking abou t http://dandewebwonders.com/aliendata/phpguessing.php Here is my code <?php $guess=$_POST['guess']; $number= 25; if($guess>$number) { echo "Sorry, your guess is too high, try again"; echo "<form method=\"post\" name=\"guess\"> <input type=\"hidden\" name=\"number\" value=\"$number\"> Pick a number 1 through 50: <input name=\"guess\" type=\"text\"> <input name=\"submit\" type=\"submit\" value=\"Submit Guess\"> </form>"; }elseif($guess <= 15){ echo "Sorry, your guess is too low, try again"; echo "<form method=\"post\" name=\"guess\"> <input type=\"hidden\" name=\"number\" value=\"$number\"> Pick a number 1 through 50: <input name=\"guess\" type=\"text\"> <input name=\"submit\" type=\"submit\" value=\"Submit Guess\"> </form>"; }elseif($guess>15 && $guess<$number){ echo "You are getting Close!"; echo "<form method=\"post\" name=\"guess\"> <input type=\"hidden\" name=\"number\" value=\"$number\"> Pick a number 1 through 50: <input name=\"guess\" type=\"text\"> <input name=\"submit\" type=\"submit\" value=\"Submit Guess\"> </form>"; }elseif($guess==$number) { echo str_repeat("You got it, good guess", 25); echo "<form method=\"post\" name=\"guess\"> <input type=\"hidden\" name=\"number\" value=\"$number\"> Pick a number 1 through 50: <input name=\"guess\" type=\"text\"> <input name=\"submit\" type=\"submit\" value=\"Submit Guess\"> </form>"; } else{ ?><form method="post" name="guess"> <input type="hidden" name="number" value="<?php echo $number; ?>"> Pick a number 1 through 50: <input name="guess" type="text"> <input name="submit" type="submit" value="Submit Guess"> </form> <?php } ?>
  9. I have my code almost working, I am still new with this so if someone could help me understand why this thing is letting you know you win if you choose anything between 20 and 25? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Computer can you guess my number</title> <style type = "text/css"> #footer {font-size:xx-small; text-align:center; clear:right; padding-bottom:20px; } body { background-image:url("img_tree.png"); color: RED;text-align:center } p { color: Blue; text-align:center;} </style> </head> <body> <?php $guess=$_POST['guess']; $number= 25; if($guess>$number) { echo "Sorry, your guess is too high, try again"; echo "<form method=\"post\" name=\"guess\"> <input type=\"hidden\" name=\"number\" value=\"$number\"> Pick a number 1 through 25: <input name=\"guess\" type=\"text\"> <input name=\"submit\" type=\"submit\" value=\"Submit Guess\"> </form>"; }elseif($guess <15){ echo "Sorry, your guess is too low, try again"; echo "<form method=\"post\" name=\"guess\"> <input type=\"hidden\" name=\"number\" value=\"$number\"> Pick a number 1 through 25: <input name=\"guess\" type=\"text\"> <input name=\"submit\" type=\"submit\" value=\"Submit Guess\"> </form>"; }elseif($guess = $number) { echo "You got it, good guess"; echo "You got it, good guess."; $number= 25; echo "<form method=\"post\" name=\"guess\"> <input type=\"hidden\" name=\"number\" value=\"$number\"> Pick a number 1 through 25: <input name=\"guess\" type=\"text\"> <input name=\"submit\" type=\"submit\" value=\"Submit Guess\"> </form>"; } else{ ?><form method="post" name="guess"> <input type="hidden" name="number" value="<?php echo $number; ?>"> Pick a number 1 through 25: <input name="guess" type="text"> <input name="submit" type="submit" value="Submit Guess"> </form> <?php } ?> </body> </html>
  10. I fugured it out, Yes I had just figured that one out.. thank you so much !!!:-)
  11. I cannot understand why my background color is not changing when user selects it ?http://dandewebwonders.com/aliendata/response.php?username=Deanna&background=yellow&submit=Submit+Query <!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> <style type="text/css"> body { background-color: <?= $_GET['color'] ?>; } </style> </head> <body> Hello, <?= $_GET['username'] ?>! </body> </html> <!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> <style type="text/css"> option.red { background-color: red; } option.yellow { background-color: yellow; } option.blue { background-color: blue; } option.orange { background-color: #FF8040; } option.purple { background-color: #800080; } </style> </head> <body> <form action="response.php" method="get"> What is your name? <input type="text" name="username" size="20" /> <select name="background"> <option style="display:none;" selected="selected">color</option> <option class="red" value="red">Red</option> <option class="yellow" value="yellow">Yellow</option> <option class="blue" value="blue">Blue</option> <option class="orange" value="orange">Orange</option> <option class="purple" value="purple">Purple</option> </select> <input type="submit" name="submit" /> </form> </body> </html>
  12. Got my code to work!!!!! On to the next problem lol

  13. echo '<p> <b>'.$row['topictitle'].'</b> '."<a href='". $row['topicdescription'] ."' >".'</p>'; I tried this, and it does not work... any ideas?
  14. Yes I am not understanding how to echo an anchor tag using php when I run my query, I want the results in an anchor tag and cant seem to get it to work..
  15. echo '<p> <b>'.$row['topictitle'].'</b> '.$row['topicdescription'].'</p>' ; Im trying to make the 'topicdescription' a clickable link. I am trying to make my personal pdf library easier to access for my friends, so when they query the database I want it so they can just click on the link to download the material. Please and thank you . I have tried a few different things but nothing works so far. I thought I would just bring it to the experts.
×
×
  • 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.