Questions tagged [php]

PHP is a general-purpose, open source scripting language widely used in web development.

15 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
2answers
477 views

chmod doesn't work on individual files?

When I do something like chmod 000 dir I don't see the directory when I open the server but when I do this on individual files and not the directory chmod 000 file.php I still see that file in my ...
1
vote
3answers
157 views

Excel into MySQL

A website has a link to download an excel file. I need some of those columns in my MySQL database. Is there a relatively painless way to: 1. use phpmyadmin's import tab 2. use a method similar to ...
1
vote
1answer
111 views

Install MongoDB on appliance - Uint type error

For my final project, I'm trying to install the MongoDB PHP driver. While compiling, I get the error unknown type name 'uint'; did you mean 'int'?. It seems like I am missing a library, but which one? ...
0
votes
0answers
10 views

CS50 bash: apache50: command not found

I'm trying to incorporate PHP code into html code to create a comments section on a website for my final project. When I try to set up PHP using apache50 I get the error as below. Can anyone think of ...
0
votes
1answer
1k views

Editable html table (PHP, MySQL) - doesn't save changes in database

For my final project, i'm trying to make my html tables editable by users, with updating data in MySQL. I've found in web a few js scripts for such case but no one works as needed. My result - ...
0
votes
1answer
34 views

query always fails to execute in php

I am trying to insert student exam answers to a table online_exam_marks. I stored $_POST values after ensuring that $_POST value is not empty and if they empty I just set it to $a = '0' to different ...
0
votes
1answer
160 views

How to debug pset8 search.php?

Hello I have trouble to do any debuging in search.php pset8. In previous problems there where always some way to print my variables and figure out what was wrong with my querys och logics. However in ...
0
votes
0answers
29 views

my code takes too long to execute

This loop here takes too long to be executed. Does it mean I am getting into an infinite loop? How can I fix it ? it is suppose to be reading from a csv file and storing them into an array then ...
0
votes
1answer
513 views

pset7 register.php !isset() vs empty(): !isset() doesn't work

I am at register.php now. I will be grateful for explanation why !isset() doesn't do the job while empty() perfectly does. For example, if (empty($_POST["username"])) { apologize("Please, ...
0
votes
2answers
675 views

API call with file_gets_content() doesn't work with variables

for my final project I am trying to query a barcode database through via their API. When I hardcode the barcode and api key, everything works as expected but when I am using variables, ...
0
votes
1answer
86 views

How to Access Appliance Website In Vhosts

If you are past pset7, or at least have set up PHPMyadmin, you can access your PHPmyadmin databases outside of the appliance by going to ip.ad.dr.ess/phpmyadmin. How do I access my websites in vhosts ...
0
votes
1answer
136 views

Setting up a connection between php and mysql outside of CS50 Appliance using the methods of CS50 Finance?

I recently decided to get my final project from last year online. But I ran into a lot of trouble. Can someone help me? I was using the functions in last year's CS50 finance to connect php to mysql db,...
0
votes
0answers
284 views

Array to string conversion error in PHP

In public/quote.php, I have a line: render("quote.php", ["price"=>$s["price"]); Then in template.php, I try to print: print("Price: " . $s["price"]); but I keep getting this error: Array to ...
0
votes
1answer
208 views

pset7 unknown column in where clause

This throws an error saying YHOO is an unknown column...I thought 'symbol' was the column name in this query? $id = 6; $symbol = "YHOO"; $shares_query = query("SELECT shares FROM portfolio WHERE id = ...
0
votes
1answer
417 views

what is the username and passwrod when sending mail via phpmailer?

how do i know what is the password and username for phpmailer for pset7. i am using the off campus smtp server smtp.comcast.net but everytime i try to send an email it gets rejected due to the need ...