-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
And we are assuming that despite your input field containing multiple data items that you are NOT storing that way in your db table. You should have a hashtag table that has a user id field and a hashtag field and your table will then have multiple records for a user as in: user tag john #tag1 john #tag2 john #tag3 john #tag4 Mary #tag1 Mary #tag2
-
Then he should get a solution from the teacher or from the other students so that he gets something appropriate for the context of his course.
-
Hopefully you have realized that good database organization is how you properly manage any and all data. By having it well designed you are then able to write queries to answer any question at any time without having to do things like you proposed in your post. No need to move data to another table, no need to remove data when it 'expires'. You simply store your data and query it and format the output to answer any question that is asked. Yes - you eventually may remove data that is beyond use, but I suggest that you develop a process to archive the old data so that you can analyze it over long periods of time if that is the nature of your activity/business.
-
You skipped a class, a test no less, and you want someone here to write your answer for you. SHAME ON YOU AND SHAME ON ANYONE HERE WHO GIVES YOU WHAT YOU ASK FOR.
-
Warning: Division by zero in /rate.php on line 64
ginerjm replied to supermanohar's topic in PHP Coding Help
What do you want US to do about it? You didn't even show us the line that is giving you the error. -
You began with the premise that you have a db2 table and you have a php application. What IS that php application? Or did you mis-speak? I would also add - if you have a task to do and you don't know how to use php, then why don't you use something that you DO know?
-
I have no problem with it if you follow my instructions as well as everyone else who adds their $.02. Inside, outside, any side - Don't Create Stupid Code!
-
Original Image Size, Thumbnail Image, Anchor Tag, Referencing?
ginerjm replied to glassfish's topic in PHP Coding Help
You want to be sure that the name you create doesn't wipe out another file. I think 'name integrity' is an apt term. Dont' you? Your concern is about the possibility of two instances of your script creating the same random name at the same time. Even tho I don't quite follow your convoluted logic (and wasted logic) I dont' think that's going to happen. -
Original Image Size, Thumbnail Image, Anchor Tag, Referencing?
ginerjm replied to glassfish's topic in PHP Coding Help
Are you opening up your own image museum? What are you worried about? What is "working out" supposed to mean? Basically what I see in your posts is : 1 - accept an image that you allowed someone to upload thru your form. 2 - rename that image and store it someplace To be safe you have asked how to ensure name integrity. You have been offered the quite simple solution of checking if that filename exists in your images folder before saving the new file there. Case closed? -
In case you don't realize what gristol is telling you - YOU ARE DOING SOMETHING VERY STUPID HERE. 1 - separate your code (php) from your html - makes no sense to mix them all together. 2 - Read the manual for any one of the MySQL_* functions. NOTICE THE BIG RED BOX SAYING NOT TO USE IT!!! 3 - Do not in any way allow the user to write your query for you. What?! Are you that stupid that you would let someone actually write a malicious query that could delete your entire database - not just a table - your entire database? 4 - Check your work before posting it for others to work with. You have an input tag that you "attempt" to close with a </textarea> tag. What the h. is this? 5 - Where ever you got this code - return it and don't use anything from that source again. You have no idea what mistake you are attempting to make. Lastly - what you are trying to do is called AJAX. It allows you to have a page that contains JS code that will call a php script and get a response from it and post that result back to the page without doing a refresh. Depending upon the speed of your connection and your server it can be quite instantaneous. I think that is what you want. You should read up on THAT too.
-
Maybe post this in the CMS section if you want to reach the joomla experts.
-
Try googling how to use js to open a window and you will see how you can generate a window of the size you want as well as trigger a php script to take over that window. I think that is what you want.
- 5 replies
-
- php
- javascript
-
(and 2 more)
Tagged with:
-
Why not post in the wordpress section? The functions you are using mean nothing to those who don't use it.
-
Original Image Size, Thumbnail Image, Anchor Tag, Referencing?
ginerjm replied to glassfish's topic in PHP Coding Help
Same silly code again. When are you going to stop using it? As for ensuring no duplicates, how about just using a file system function to check if it already exists? -
Basically you want to write some code like this: if $_POST['id'] is not set, output a form that has one text field for the id and one submit that calls back to this script using POST, not GET when it is submitted and exit and wait for the input. if $_POST['id'] is set, then grab it, validate it, and use it in a prepared query to get the data you want to display. Using those query results ($pdo->fetch(PDO::FETCH_ASSOC) ) build some html to display these fields in whatever order you want. You can use an html table, or some div tags to arrange it on screen. Be sure to place some submit buttons on it to handle what ever you want to do next. Then exit and wait. This is a very simple solution. You need to be safe and secure in handling the user input and writing the query.
-
Try echoing out the value of $piccurr to be sure it is what you think it is. As a matter of practice one should always wrap indices in quotes when specifying them literally. For ex. you s/b using $nt2['Picture01'] And what exactly does this 'diddly squat' look like? A blank page? An error message? Anything?.
-
Your English is not clear enough to me. Quote: 'script in JS would then create/open windows with php code' makes no sense. One can't have php code inside a js script. What are you trying to describe here? Again - you use js to open the window and pass control to the script named as one of the parms of the JS open command. You simply have to port all of your curren tphp code from the calling script to the JS-called script.
- 5 replies
-
- php
- javascript
-
(and 2 more)
Tagged with:
-
The easy way is to crate the page in a php script and then use js to open the window and pass control to that script. You can easily find many examples of this on google.
- 5 replies
-
- php
- javascript
-
(and 2 more)
Tagged with:
-
Guys I need Help some need to Combine Checkbox and Textbox Value
ginerjm replied to sohailsaif's topic in PHP Coding Help
What do you want to do when they select two or more checkboxes. Make a string like "example.com.net.org"? -
Guys I need Help some need to Combine Checkbox and Textbox Value
ginerjm replied to sohailsaif's topic in PHP Coding Help
So - you really want an introduction to simple and basic php syntax. May we suggest reading the first few chapters of the manual? You'll learn a lot - especially how to concatenate strings. -
Can you please tell me what each of these lines means?
ginerjm replied to Chrisj's topic in PHP Coding Help
Looking at this code I see no setting of a 'thumbnail' field. But I do see some horribly bad usage of the @ sign to suppress errors. WHY WOULD YOU EVER WANT TO HIDE ERRORS????? Dont' to it. -
Can you please tell me what each of these lines means?
ginerjm replied to Chrisj's topic in PHP Coding Help
Show us how the form is created. -
Can you please tell me what each of these lines means?
ginerjm replied to Chrisj's topic in PHP Coding Help
$allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); // ADD CHECK FOR VALID FILE if (!in_array($extension,$allowedExts)) { echo ("Error - bad file uploaded"); exit(); // or do whatever else you want here } $length = 20; $newfilename = $_SESSION['user_id'].$_FILES["file"]["name"]; // $thumbnail = $newfilename; // DON'T NEED THIS . "." . $extension; // move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail); // $sql = "INSERT INTO videos ( filename ) VALUES( '$thumbnail' )"; // ADDED QUOTES ON $THUMBNAIL // mysql_query($sql); $file_location = '<a href="http://www.--.com/upload/' . $thumbnail . '">' . $thumbnail . '</a>'; $description = $description . " \n " . $newfilename; -
Why do you do your connect after you run your query???
-
Can you please tell me what each of these lines means?
ginerjm replied to Chrisj's topic in PHP Coding Help
leave out the part that grabs $extension and remove it from the later ref.