Jordan Hagins Ответов: 1

Мне бы не помешала помощь с некоторыми проблемами PHP кодирования:


1. На самом деле description.php, используйте столбцы из таблицы items, которые выводят информацию на страницу соответствующим образом (т. е. item_name будет идти в H3 для “общего имени”, Item_Price будет выводиться в Местоположение цены на странице) – убедитесь, что вы получаете Item_Id из URL-адреса, чтобы показать только тот элемент, на который вы нажали. Используйте Item_Id для динамического изменения содержимого страницы описания, извлекая информацию, сохраненную в базе данных о каждом элементе. Вспомните отзывы пользователей.

• Вам понадобится изображение для каждого из элементов, перечисленных в вашей базе данных. Измените размер каждого изображения, чтобы оно соответствовало его размеру.
• Предложение: храните изображения элементов в папке itemImages, чтобы сохранить вашу основную папку организованной.

• Вам понадобится другой запрос, чтобы выбрать отзывы пользователей для этого элемента и отобразить их на странице. Если для этого товара нет отзывов, спросите пользователя, не хочет ли он оставить один из них.

• Если пользователь действительно предоставляет отзыв, обновите таблицу отзывов обзором, элементом, пользователем и временем публикации отзыва.

• Напоминание: дезинфицируйте любую информацию, которую вы получаете от пользователя.


2. На самом деле profile.php, получить любую информацию, хранящуюся в таблице customers для пользователя, который вошел в систему.

• Используйте эту информацию для динамического изменения содержимого страницы профиля, извлекая информацию, хранящуюся в базе данных, и изменяя ее в соответствии с требованиями веб-страницы.

• Если нет информации для конкретного поля, сообщите пользователю, что для этого поля нет “ответа” (или аналогичной формулировки). *Если пользователь не указал местоположение, но предоставил другую информацию, то только область местоположения будет иметь текст “нет ответа”.

• Пользователи должны иметь возможность обновлять и изменять изображение своего профиля. Разрешите изображения в форматах GIF, JPEG или PNG. Переименуйте имя файла изображения в имя пользователя и соответствующее расширение. Для облегчения технического обслуживания, хранения этих изображений в папке custImages.
$location = "custImages/" . $custUserName . $ext; //где $custUserName-это переменная, которую вы использовали для имени пользователя вашего клиента.
move_uploaded_file($_FILES больше["изображение"]["tmp_name"], $расположение);

• Пользователи должны иметь возможность обновлять только те части своего профиля, которые они хотят. Если одно из полей формы заполнено, обновите таблицу customers для этого пользователя с помощью предоставленной им информации. Не забудьте очистить каждое поле и указать дату, когда пользователь в последний раз обновлял свою информацию.


Что я уже пробовал:

<body>
   <header>
   <h1>Item Descriptions</h1>
   </header>
   <nav>
      <a href="index.php" >Home</a>
      <a href="login.php" >Log-in</a>
      <a href="profile.php" >Profile</a>
      <a href="register.php" >Register</a>
	  <a href="items.php" >Items</a>
      <a href="descriptions.php" >Item Description</a>
      <a href="cart.php" >View Cart
   </nav>
   <main>
   <h1 id="A1">The Simpsons Memorabiliia</h1>
   <h2 id="B1">The Simpsons' Couch</h2>
   <img src="photos/sc.jpg" alt="The Simpsons' Couch">
   <p>Price:$400</p>
   <p>The couch gag is the running visual joke in the Opening Sequence of The Simpsons. The couch gag changes from episode to episode, usually with wacky events occurring involving the couch. Now you can enter your own home in wacky and comedic ways with the a replica Simpson's couch.</p>   
   <h2 id="B2">The Simpsons' Pink Sedan</h2>
   <img src="photos/pink_sedan.jpg" alt="The Simpsons' Pink Sedan">
   <p>Price:$10,000</p>
   <p>The Pink Sedan (or the Family Sedan) is one of two automobiles belonging to the Simpson family. It is a Plymouth Junkerolla. It is Homer's car, and he uses it almost exclusively, although Marge, Bart, Lisa and even Maggie have driven it at some point. The car features: minor damage on the left front fender (which has never been repaired), driver's side airbag, a column shifter, a bent up radio aerial, and has a *Trackstar 8-Track radio. It was made in Croatia, out of old Soviet tanks, which might explain why parts of the car are crumpled. Get you very own version today!</p>
   <h2 id="B3">The Duff Book of World Records</h2>
   <img src="photos/duff_book.jpg" alt="The Duff Book of World Records">
   <p>Price:$49.99</p>
   <p>The Duff Book of World Records is a book released by Duff to help settle bar bets. There is also a television edition of the book hosted by Johnny Herelately. Settle bar bets of your own. Get yours today.</p>
   <h1 id="A2">Rick and Morty Memorabiliia</h1>
   <h2 id="B4">Rick's Portal Gun</h2>
   <img src="photos/rpg.jpg" alt="Rick's Portal Gun">
   <p>Price:$1,000,000,000</p>
   <p>The Portal Gun is a gadget that allows the user(s) to travel between different universes, dimensions, and realities. The Gun was likely created by a Rick, although it is unknown which one. Now you can have your own portal gun to travel the cosmos with your very own portal gun. Go anywhere your want!</p>
   <h2 id="B5">Mr. Meeseeks Box</h2>
   <img src="photos/Mr._Meeseeks_Box.png" alt="Mr. Meeseeks Box">
   <p>Price:$750,000</p>
   <p>It was introduced in the episode "Meeseeks and Destroy." It is a gadget which creates a Mr. Meeseeks for the purpose of completing one objective. Once it completes the objective, Mr. Meeseeks vanished. Never have to do anything for yourself again. Get yours today!!!</p>
   <h2 id="B6">The Interdimensional Cable</h2>
   <img src="photos/interdimensional_cable.jpg" alt="The Interdimensional Cable">
   <p>Price:$999.99</p>
   <p>The Interdimensional Cable is a cable box invented by Rick that gives access to television shows across every dimension. Watch literally whatever you what with this cable box. For just the low low price of 999.99!</p>
   <h1 id="A3">Family Guy Memorabiliia</h1>
   <h2 id="B7">Stewie's Time Machine</h2>
   <img src="photos/stm.jpg" alt="Stewie Time Machine">
   <p>Price:$100,000,000</p>
   <p>A time machine was first used in "Mind Over Murder" when Stewie Griffin originally creates it to avoid teething but it doesn't end up going as planned. When people at the bar peter started in the basement copy his plans, all the events of the episode are erased. Ever since the events of that episode the time machine has been used in several episodes, and now you can have a time machine of your own!</p>
   <h2 id="B8">Stewie's Shrink Ray</h2>
   <img src="photos/stewie_shrink_ray.jpg" alt="Stewie's Shrink Ray">
   <p>Price:$1,000,000</p>
   <p>Stewie builds a shrink ray and turns it loose on Brian. After getting a satisfactory apology from him, Stewie turns his back to restore him to his normal size, but Brian finds himself attacked by a rat who drags him into his hole. Stewie is forced to shrink himself to enter the rat hole where he kills the rat, but when he attempts to restore the pair to their normal size, Brian pushes the wrong button and ends up shrinking them to microscopic size. You can now shrink whatever you want with your very own shrink ray.</p>
   <h2 id="B9">Stewie's Transporter</h2>
   <img src="photos/stewie_transporter.jpg" alt="Stewie's Transporter">
   <p>Price:$100,000</p>
   <p>While at the Star Trek convention, Stewie blows a fuse when he doesn't get a chance to ask the Star Trek: The Next Generation cast members any questions. He devises a plan, builds a transporter and beams the entire cast to his bedroom so they can spend a fun-filled day together in Quahog. Now teleport anywhere you want with your very own transporter.</p>
   <h1 id="A4">Futurama Memorabiliia</h1>
   <h2 id="B10">Planet Express Ship</h2>
   <img src="photos/pes.jpg" alt="Planet Express Ship">
   <p>Price:$1,000,000</p>
   <p>The Planet Express ship, named Old Bessie by the Professor, is a bright green (actual name electric mucus) delivery spacecraft owned by Planet Express. It is used by Bender, Fry and Leela to take various packages all over the galaxy. It has windshield wipers, a coffee maker, cup holders, an elephant detector, a microwave, game room, cargo hold and a laundry room. Now own your own P.E.S. Travel the universe in comedic comfort. Get yours now!</p>  
   <h2 id="B11">What-if Machine</h2>
   <img src="photos/what_if_machine.jpg" alt="What-if Machine">
   <p>Price:$7,500</p>
   <p>The What-if Machine is a machine invented by Professor Farnsworth. When it is asked a "what if" question it will give a display scenario of what will happen. It is unknown when the professor invented it, but its first appearance was in "Anthology of Interest I". Every time the machine is asked a new question, the professor uses a different button, knob, switch etc. Now have any question you want answered with your very own what-if machine!</p>   
   <h2 id="B12">The Farnsworth Smell-O-Scope</h2>
   <img src="photos/smelloscope.jpg" alt="The Farnsworth Smell-O-Scope">
   <p>Price:$2,900</p>
   <p>The Smell-O-Scope was an invention created by Professor Hubert J. Farnsworth. It allowed users to smell odors over extremely long distances. Smell anything in the galaxy with you very own Smell-O-Scope.</p>
   </main>
</body>
   <footer>© September 10, 2020 <a href="mailto:xxxxxxxxxxxxxxxxxxxxxx">xxxxxxxxxxxxxxxxxxxxxxx</a></footer>
</html>

1 Ответов

Рейтинг:
0

OriginalGriff

Мы более чем готовы помочь тем, кто застрял, но это не значит, что мы здесь, чтобы сделать все это для вас! Мы не можем сделать всю работу, вам либо платят за это, либо это часть ваших оценок, и было бы совсем несправедливо, если бы мы сделали все это за вас.
И до сих пор вы вообще не написали PHP ...

Поэтому нам нужно, чтобы вы сделали работу, и мы поможем вам, когда вы застряли. Это не значит, что мы дадим вам пошаговое решение, которое вы можете сдать!
Начните с объяснения, где вы находитесь в данный момент и каков следующий шаг в этом процессе. Затем расскажите нам, что вы пытались сделать, чтобы этот следующий шаг сработал, и что произошло, когда вы это сделали.

Если у вас вообще возникли проблемы с началом работы, то это может помочь: Как написать код для решения проблемы, руководство для начинающих[^]