Limiting User Mysql Entries
I have a script i'm making which is going to be used to search for reciprocal links on different sites and I have user levels such as free, paid, ect... I want to make it so that if the person signs up as a free user they can only add like 2-3 domains to be searched for their links. How would I limit the number of domains allowed to be searched? Would I limit the number of mysql entries allowed in the table for the domains?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Multiple Entries For Same User?
I am creating this form, and instead of having a huge list of input boxes for visitors to fill out, I am wondering if it is possible to have the user click on add another button, and a new submittion will be added to that persons file.
PHP, MySQL & Limiting Access
I have a project for work, and I'm not sure how to efficiently do what I need to do. I'm hoping someone out there can help. Project is this: I'm creating a web-based interface where people at my company (operators) can enter data for service calls. All data entered is run thru one or more PHP scripts for error checking and then stored in a MySQL database on a server here in the office. What I'm looking to do is to limit access to certain operators so they can only do certain functions (ex: add a service call, but not delete one), whereas admins such as myself would have full access to everything. Ideally, at some point in the future, we plan to roll this interface out to our clients so they may do the same features within their company. Obviously, they would only gain access to data related to their company, as to protect the privacy of others. Hierarchy would be something like this: 1. UberAdmins (such as myself) -Have access to everything and to all commands. 2. Operators -Have access to everything, but not all commands. 3. Our clients -Have access to their data only, and to all commands. 4. Our clients' operators -Have access to their data only, but not all commands. The difficult thing is that our clients may run several businesses, so they would have to have access to several groups. In essence, they'd have multiple groups (their businesses) within a group (their group) within a group (everything). What is the easiest and most secure way to do something like this? I'm not looking for actual code but merely suggestions. Please reply if there is something I wasn't clear on.
Limiting The Amount Of Text From A MySQL Call
I have the following code that pulls some information from a database and presents it (obviously), it also has a link to find out more about the presented information. One of the feilds is called a biography, I want to limit the amount of the field "biography" that is displayed, like the first 200 characters (maybe even ending in a ...) and have the rest of the biography dislay when the person clicks on the corresponding link. Is this possible? Code:
Deleting Entries From Mysql
I have business listings that I have pulled from a database(MySQL) and printed to the page, in an admin page, for review. I'm trying to write a script to add and one to delete the listing. I get an SQL error, 'check the manual for blah blah near " on line 1' Here is the 'delete script:
Get All Entries From Today (mysql)
I currently have a page that each time a user visits it, the pageid and timestamp is thrown into a mysql daabase. so the database looks like so: linkid time 3 2007-08-22 17:26:21 3 2007-08-20 17:26:21 3 2007-08-22 18:36:59 2 2007-08-22 18:37:21 What i need is for php to show the total amount of visits today as per a certain time zone (or if thats not possible, the past 24 hours) soo.. Search for all occurrences where linkid = 3 today for a specific timezone (or 24 hours) MORE SPECIFICALLY User 1: Lives in New York (EST -5) registers for my site and sends visitors to his linkid (3) After two days, this is what the mysql table looks like: linkid time 3 -=- 2007-08-22 17:26:21 3 -=- 2007-08-20 17:26:21 3 -=- 2007-08-22 18:36:59 But mysql time isn't Eastern time, its another timezone. So when a visitor comes to user1's page at 3pm EST, mysql registers the time as 2007-08-22 17:26:21 So... I want to first add/subtract the number of numbers in the mysql database depending upon the user, and then see the amount of visitors for the day.
MYSQL Entries Won't Update
I am trying to update some entries in a mysql database that will append the filename to the end of a thumbnail directory entry. So for example /images/thumb/ would become /images/thumb/12345.jpg. I am stumped because the below code gives no php or mysql errors but the entries are not updated in the mysql db! Code:
Multi Entries Update To Mysql
Could someone help me to figure out how to upgrade multi entries to Mysql by using PHP? Say, I have a table on Mysql id Priority 1 Okay 2 wait 3 later 4 asap 5 hold Now I want to upgrade that table to: id priority 1 hold 2 asap 3 okay 4 wait 5 later Is it possible to upgrade multi entries with one submitt button? If yes, could you tell me how it could be done. I knew I could do it by each entry (submitt button). Update priority set priority='$priority' where id = '$id'
Selecting 4 Random MySQL DB Entries?
I have a table set up in my MySQL database called 'features'. This table has 10 entries, but I only want to select 4 random rows and display them out in tables.
Populating Dropdown With Mysql Entries
I would like to create a combobox in Flash which is populated with mysql data and programmed with php. For example: There are 3 entries in database .ie. apple, bannana, peach. Now these I want in combobox in Flash MX/flash5.
Day View Calendar / Mysql Entries
I am trying to create a day view of a lab resource reservation system. So far, I've been able to generate a day view table with php, using variables for start time, end time and periods. Periods represent intervals on the day view. I have two columns in the table: the first one starts at the start time (say 8:00) and there is a row for every time until the end time, each row time being increased by the period, ie. 8:00, 8:30, 9:00 where the period is 30 minutes and the end time is 9:00. My second column in the table is filled with unix timestamps representing the date for that particular row, so the 8:00 row on July 1, 2007 is represented by a timestamp of 1183291200. I then created variables to represent start and end times and date of a reserved lab resource. I did a little switch statement in my second column of my table saying, if that row's timestamp equals the start or end time of my reserved resource, than give it a certain style. All well and good, except I need to tie this into a mysql database where the reservation details (start, end, date) are stored. Where I am getting fuzzy is how to integrate the query results from the database into my little system. I would like to have that second column pick up the results from my query and display the reservations, but I'm not sure now to do that. I'd like to post the code here, but I'm not sure how to post php code on these forums without getting yelled at for doing it wrong (I did that once, can you tell?)
INSERT Into Mysql Alway Make Two Entries
I code some site and because Im a freak I made my own session-handling. When a user open up my site it will check if there is a ssid in the url if not generate one. this will be done by a function generate_ssid() and works fine. next step is to register the ssid in the table session this will be done by the following code: ****************************** function ssid_register($ssid,$login,$uid,$admin){ $connect = mysql_connect( $GLOBALS["db_host"], $GLOBALS["db_user"], $GLOBALS["db_password"]) or die($GLOBALS["db_error"]); mysql_select_db($GLOBALS["db_name"],$connect) or die($GLOBALS["db_error"].'<br>ErrorCode s.001-con'); $result = mysql_query("INSERT INTO session SET ssid='$season',ip='$rip'",$connect); echo ($rs); return; } ******************************** I redesigned the INSERT INTO part into all possible syntax but everytime I look into the db, there are two entries with two DIFFERENT ssids. The only way it works correct is to dont use a variable on the first place. Means if I use ssid='godhelpmetofindaworkingsolution' it works great but is not realy what I want. As told above a "INSERT INTO session (ssid) VALUES ($ssid)" also has the effect of two new db-entries.
Populate MySQL With Multiple Text Box Entries
I have about 300 rows of mysql data which I have chosen to diplay with a text box at the end of each row, that is available for adding comments. I would like to be able to add comments to entries and then have an update scripte that would take the text box, named "MC" and place the data in its row identified by a hidden field which would corrrespond to the Primary Key of the MySQL Database. I've done something similar using check box arrays, ie. Checkbox name="MC[]" My question is whether I can write a script that would test for a value in the corresponding text box, and update the MySQL data accordingly. I have also provided in my display script that if the MC column is already populated in MySQL it will not display in the form.
Deleting Duplicate Entries From MySQL Database Table
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone | ------------------------------------------------------- | mr x | 8th lane | 124364 | | mr x | 6th lane | 435783 | | mrs x | 6th lane | 435783 | | mr x | 8th lane | 124364 | ------------------------------------------------------- Quote:
Date Dropdown From Mysql Date Entries
For the PHP gurus out there, here is what I want to do: create a dropdown list of available dates from a mysql database date entries. But the dropdown/s should have 3 separate fields in month, day and year which in effect shows only those months, days and years that have corresponding entries from the database. Planning to use this in the archive section of an online news publication so people can select issues to view via dropdown list that have corresponding entries only.
Limiting Input!
I have recently started a project, and I need to limit user input. I need to make it so the user can only make 1 guess per day. It will collect all the users/guesses for one day, then at the end of the day(12 AM) I will drop all the guesses so they can start guessing again. So I just need to know how to make it so they can only make 1 guess. Code:
Limiting No. Charcters
how to limit the number of charcters when displaying something and having the ending as "..." For example displaying news articles and then a link saying Click Here For More Code:
Limiting Words
I am trying to get a list of news stories from a database and list them, limiting them to a just 100 characters, and rounding them off to the nearest whole sentance, with a Read More » link to read in full. I have written the code, but its not working. Code:
Limiting Search
I have a search result page that is meant to limit the results to 5 per page and then you click next to view the next results (and next for more results and previous for the previous page). The problem is that when you perform the search it works fine but when you want to go to the next page nothing happens. I think the reason is that it looses the search criteria. Code:
Download Limiting Script
I am looking to make a script for file downloads. Been having a large problem with web-mirroring programs soaking up huge amounts of bandwith. the script will have to: 1.) accept input for the file's name in this form ?file=blah.zip 2.) take the user to a screen where they can click a post button to begin downloading the file 3.) after clicking that post button and before sending the file, the script will need to make sre that the user is not currently downlaoding any other files, and that the referer was indeed that same script. this will probably prevent most spiders from sucking the bandwith and driving up the bills, but even if they don't it will slow them sown quite a bit so that the bandwith is managable. does any one have any ideas on such a script?
Limiting Simultaneous Logins
What I am trying to do is to limit the number of simultaneous logins of each registered user. Currently each user will be authenticated against a database and a PHP session will be created for him (say $_SESSION['username']). Then we will check for this session in all pages. Which solution do you recommend to limit the number of simultaneous logins by each user?
Limiting Text Output From DB
I have developed a simple from system that allows users to input some comments. This all works fine, however when I try to retrieve the comments I only want to display 100 characters. I am new to PHP, but was wondering if there is a string function that will let me take the data from a table in my database and then only display 100 characters followed by "..." afterwards. Also I have thought of a potential problem... if someone enters less than 100 characters I only want to show the amount they have entered.
Limiting Search Results
I have written a search script for my database but now I want to limit the results to ten a page and then make it possible to see the next (or previous) page. All my attempts so far have failed. Code:
Limiting Charactors Returned.
I'm echoing out table cell kept in an array using: $list['email'] It echos the user's email address. But if i had an email address that was: dwaniodwuaiobwaiubdwauibdvwaijdvwavuwavwad@dwad.com it would strech the table. I want to limit the amount of charactors. put ...'s inbetween Limit the output to 10 charactors.
Limiting Character Length
I have a script that pulls latest forum posts with a mysql query. When I display the list, how do I limit the name of the topics and follow them with "..." if they are too long? For example, the two latest posts are Hello, everyone, I am new here. That's sixteen characters. How would I make that display as say "Hello, Everyone, I am..."
Calculation And Limiting Decimals
I have a greater total of 61 and I score 45 $i= 61; $y= 45; $pct = ($i /$y) * 100; one is tha correct Two how can i limit the number that result diplays (0.987654321 - i just want .987) and how do i turn off this error message??? Warning: Division by zero in localhostinfo.php on line xxx
Limiting Access To Upload Area
I'm in the process of creating a Linux+Apache+PHP website with a public area and an admin area for configuration and updates. The What: One of the features of the admin area is image-upload, where the images are subsequently viewably by the general public. Currently I've created a dedicated "pictures" directory which world-writable into which the PHP script puts the form-uploaded images. The admin logging in is done via a database lookup, not .htaccess directives or OS permissions. The How: It seems a bit risky (is it?) to have to directory so open, is there a way I can allow the script to move files into that directory without making it a+w?
Limiting A Query By Number And Date
I run a hockey league and want to post my schedule for the upcoming season. The problem is that I have 100 games in the season and I want to limit the query to 30 games on the schedule that is posted on my website. That part was no problem for me but I also would like to have those 30 games be determined by date. So I would like the script to acquire the current date and post the next 30 games that are upcoming. I have a date field in the daatbase that is in the form YYYY-MM-DD.
Limiting Number Of Characters In A String...
If I have a long string of text in a variable, how can I "trim" the text down to a specific number of characters? So for example, if I have: $string = "This is a string"; and I just want the first four characters of the string, so just "This", how would I do that?
Limiting Results, And Display Page Numbers
How do I make it so only 50 items display per page. And if there's more than 50, it displays a link "page 2", "page 3" and so on? I know how to limit results with MySQL but how do I generate pages for the next 50 within the PHP code?
Limiting The Amount Of Text Returned From A Query
What is the best way to display a limited amount of text returned from a MySql query? I have a News articles table with a headline and text... I query the database and return both, but I only want to display say the first 30 words of the article text and append it with "... MORE" as a link to the complete article. The last part is easy, it's the limiting of the number of words displayed that has me stumped.
Limiting Number Of Records Stored In Database
Is there a way I can limit the number of records that are stored in a database? I am using a PHP guestbook script for personal use and only want to save say the last 100 messages.
Limiting/Structuring Query Data Output
Let's say I have a table called "customers" which will display many many results. What I want to be able to do is output their names in a structured table when a query is presented. For example: Customer 1, Customer 2, Customer 3, Customer 4 Customer 5, Customer 6, Customer 7, Customer 8 ... where it will always revert to the next row after every 4 results, continuing as such.
Limiting Allowed File Format For Upload...
I don't really know much about php and needed to make a web contact form for a client where the user can upload images which are then sent as an attachment with the resulting email. I kind of cheated and bought a bit of software which creates the script for you. This works great, but I am concerned about people uploading things other than images - especially after seeing this thread: [URL].... Now, obviously there is a bit of script in one of the replies which addressed my issue, but I don't know enough about php to adapt it for my own script. Therefore, I was wondering if someone would be so kind as to point out where I need to make changes and what those changes would be. I need to allow only common image files and to disallow any of the nasty stuff described in the above thread. I have created this stripped down script with my software, which addresses the essentials of uploaded image and resulting email to which it is attached, plus a section which deals with errors, http referers and stop words for security. The actual script includes more fields, but I thought it would take up too much space! PHP Code: .....
PHP, MySQL User Rights With LDAP?
I´ve got several MySQL Databases running on a Linux 8.1 Server. User rights and access to those databases are made by MySQL Database rights. On the other side I´ve got some applications that are running with permissions over a LDAP server. Now - is it possible, to organize my MySQL Database User-, table-, and access rights over that LDAP Server at once? If its possible - has anybody found a documentation for sth like that - or example configs?
PHP Script To Register User In MySQL
I am wondering is there any site or documentation on how we can write PHP script so that the user can regiter them selves and get a passowrd in their e-mail address. Then they maintain their own table (select, Insert, Delete etc).
Strange Looking Mysql.user Table
My MySQL.user table (user, host, password) looks like the following: +---------+-----------+---------------------+ | user | host | password | +---------+-----------+---------------------+ | root | localhost | | | root | % | | | | localhost | 3823a5ee1f831626 | | | % | | | jim | % | 426d920b373a5e5b | +---------+-----------+---------------------+ This looks strange to me. 1) two entries for root 2) two blank entries. 3) is jim's host correct? This is on a private, standalone system for MySQL/PHP learning purposes. If this is strange, should I remove any of these entries using SQL "Delete From"
Check Mysql Database For User
Im trying to check if a user exist in database table only if another check =YES: $sql="SELECT * FROM my_members WHERE my_private=$my_private AND my_id=$my_id"; $my_private should = 'Yes' or 'No'. If 'Yes', i need to run another check.... $sql="SELECT * FROM my_favorites WHERE my_id=$my_id AND my_uid=$sessionuser"; This check should check to see if $sessionuser exists in my_favorites.. How can i make the first one call the second only if $my_private=Yes? Or is this code even correct?
Updating User Information Php/mySQL
im fairly new to the incorporation of php and mySQL and i am looking to start off by making a user info database that will hold contact information as well as a username and password field. below is the code for the site i want to use to allow the user to "update" their info. My problem is when i click the link to "edit" info after the user has logged in, the page displays blank. Code:
PHP/MySQL And Secure User Submissions
A project I'm working on involves allowing users to submit content (text/URLs, mainly) via form, which will be added to the same database as approved content (with an "unapproved" status). However, due to my relative ignorance with PHP, I'm hesitant to do this without more info regarding how to prevent abuse/exploitation of the system.
Allow The User To Sort A Mysql Result
So what i got going on is a database that has, things about a video game, including the image location. what i want to do is have a nav bar up top, so the user can select a differnt way of sorting the mysql result, from like ASC to DESC, or sort by genre.
Question Limiting Access To A Php File / HTTP_REFERER Validation.
I'm sure there is a simple solution to this but I've looked around and can't find a answer to fit my problem. I'm a php total newb so this may seem like a stupid question. I have a php file called out.php and what this does is simply count a click and then redirect the surfer to a defined URL based on a refrence number in my db. Example: out.php?number=(a number) Now my problem is I want to limit access to this to only my site so as to keep somone else from say using my out links on thier page by simple adding a link on thier site.
Ordering & Limiting Multiple Table Rows By Date
My goal is to select rows from two tables 'shoot' & 'video' and have mysql order those tables by date and limit the number of rows returned. I want to list the latest 10 rows but am uncertain how many rows from each table will be the latest. I may have more recent shoots than videos or the opposite. How can I use a single ORDER BY and LIMIT statement for both selections? Code:
Automation - User Management - Update MySQL
What I'm trying to do is design a user management page that will allow me to update the status of a user's account with the click of 1 or 2 buttons. Preferrably the design is this, My script queries the database and returns results on users that are not activated. That part is done, what I would like to do is on the end of each row (user) have a radio button each with a value of 1, 2, or 3, which are my account status flags in my database. What I'm having a problem with is how to get the update button to only update that row without having to send a query for the entire table, or worse yet, only updating the last returned value of my while loop. What i'm looking for is some pointers on the right direction to look on how to do this. Specifically, I need to find out how to get the data that's printed in each table row into a variable so that I can query the item for that row and update that user accordingly.
Php / Mysql Multi User Concurrency Question
i have some multi user concurrency question. my process: - read from db - process data (might take as long as few seconds) - save to db during the above process, there might be some overwriting due to concurency problem in multi-user environment. i know innodb table is able to lock row record. beside the using innodb type, can anyone advise me on other possible suggestions.
|